Like our free content? Then you'll love our exclusive Club!
Divi Academy Membership gives you exclusive access to over 110 resources, including child themes, layouts, cheatsheets, tutorials, live training and member perks. And new content is added EVERY Monday!
Recipe #17 is the third of the blog layout series, how to create a large thumbnail style blog layout.
If you haven’t yet checked them our you can read How to Create a Pinterest Style Blog Layout (Recipe #15) here, and How to Create a Letterbox Style Blog Layout (Recipe #16) here.
You can view the demo for this recipe here.
So let’s get cooking!
Ingredients
The Divi Theme from Elegant Themes
Some existing blog content or sample blog content with images
Cooking time
This should take you around 15 minutes max.
Preparation
The first thing we are going to do is set up our blog module, so add a new section with one column and a blog module.
Now as our layout has white boxes, we don’t want the background to be white as you won’t see the full effect, so open up the section settings and give the section a background colour, I am using #f7f7f7.
Next, open up the blog module and apply the following settings:
Layout = Fullwidth
Posts Number = Whatever you want, I have 5
Include Categories = Any ones you want to include
Show Featured Image = Yes
Content = Show Excerpt
Read More Button = On
Show Author = Yes
Show Date = Yes
Show Categories = Yes
Show Comment Count = No
Show Pagination = Yes
Featured Image Overlay = On
Hover Overlay Colour = Whatever you want, I am using black with a opacity of .35
Hover Icon Picker = Whatever you want, I am using the magnifying glass with the + symbol
Leave any other settings at their defaults.
Click on the Custom CSS tab and give the module a custom class of ds-thumbnail-blog
Then Save & Exit
Ok, that’s the prep done, let’s get on with the styling
Method
Here is what you need to add to your Child Theme Stylesheet, epanel or even your page custom CSS box.
/*Styling for the posts*/ .ds-thumbnail-blog .et_pb_post { background-color: #fff; min-height: 350px; margin-bottom: 50px; } /*Sets the image size posts and moves it to the left of the text*/ .ds-thumbnail-blog .et_pb_post a img { float: left; width: 400px; height: 350px; object-fit: cover; margin: 0 40px 0 0; } /*Resize the overlay to fit the image*/ .ds-thumbnail-blog .et_overlay { width: 400px !important; height: 350px !important; } /*Stack the image and content on smaller screens*/ @media only screen and (max-width: 980px) { .ds-thumbnail-blog .et_pb_post a img { width: 100%; height: 500px; object-fit: cover; margin: 0 0 40px 0; } /*Resize the overlay on smaller screens*/ .ds-thumbnail-blog .et_overlay { width: 100% !important; height: 500px !important; } .ds-thumbnail-blog .et_pb_post h2 { margin: 40px 30px 20px 30px !important; } .ds-thumbnail-blog .et_pb_post p { margin: 0 30px; } .ds-thumbnail-blog a.more-link { margin: 20px 0 30px 30px; } .ds-thumbnail-blog .post-content { padding: 30px 30px 80px 30px; } } /*Add a little top padding to the post titles*/ .ds-thumbnail-blog .et_pb_post h2 { padding: 40px 0 20px 0 !important; } .ds-thumbnail-blog .et_pb_post p { font-size: 18px; margin-right: 40px; } .ds-thumbnail-blog .post-meta { font-size: 14px !important; } /*This styles the read more link*/ .ds-thumbnail-blog a.more-link { display: inline-block; position: absolute; left: 440px; border: 1px solid #000; padding: 10px !important; color: #000; margin-top: 50px; text-transform: uppercase; } @media only screen and (max-width: 980px) { .ds-thumbnail-blog a.more-link { margin: 40px 0 20px 0; } } /*This styles the read more link on hover*/ .ds-thumbnail-blog a.more-link:hover { border: 1px solid #fff; color: #fff; background: #000; } /*This adds the double arrow icon to the read more link*/ .ds-thumbnail-blog a.more-link:after { font-family: 'ETmodules'; content: "\39"; color: #000; margin-left: 5px; vertical-align: middle; } /*This styles the double arrow on hover*/ .ds-thumbnail-blog a.more-link:hover:after { color: #fff; } /*This styles the post pagination links*/ .pagination a { background: #fff; color: #000; padding: 10px; margin-top: 30px !important; -webkit-box-shadow: 6px 7px 5px -6px rgba(0, 0, 0, 0.75); -moz-box-shadow: 6px 7px 5px -6px rgba(0, 0, 0, 0.75); box-shadow: 6px 7px 5px -6px rgba(0, 0, 0, 0.75); } /*This styles the post pagination links on hover*/ .pagination a:hover { background: #000; color: #fff; }
We re using the ‘object-fit’ property again, which enables us to set a height and width for our featured images using pixels or percentages, and the ‘cover’ value of the object-fit property will essentially resize the image, keep it central and clip where necessary without affecting the aspect ratio. One downside of this method is that it is not supported in IE (is anything?) or Microsoft Edge, however it is officially on the Edge list of requested CSS support so hopefully it shouldn’t be too long.
Also, be sure to set the excerpt text in the excerpt field of your posts, this will work if you aren’t using a manual excerpt but you may have a few issues with alignment of the read more button as Divi will pull the excerpt from the main post content which makes controlling the amount of content and targeting it with CSS more difficult. More on controlling the excerpt length soon .
And that’s it. you should now have a large thumbnail style blog layout similar to my demo.
If you found this helpful please leave a comment and subscribe to my newsletter for all my latest Divi related content.
Michelle X
how do you get these different sizes?
Fantastic! But how to set the same look for display in each category? For example: https://playground.divisoup.com/category/cars/
Hi Michelle, Thank you for your amazing work. I just joined your FB group.
I have a tiny issue I can’t seem to figure out. My text is completely flushed to the left. Any tips on fixing that please? Thanks!
https://www.createwithlina.com/blog/
It looks like your margin settings are being overridden by Divi. First, turn off minification and static css in Divi > Theme options general and builder tabs and clear all your caches. If that does not fix it, find this section of CSS: .ds-thumbnail-blog .et_pb_post a img { float: left; width: 400px; height: 350px; object-fit: cover; margin: 0px 40px 0px 0px; } And replace it with: .ds-thumbnail-blog .et_pb_post a img { float: left; width: 400px; height: 350px; object-fit: cover; margin: 0px 40px 0px 0px !important; }
Thank you Michelle SO much! Option #2 worked. You’re amazing and so kind. Thank you
You are most welcome
Hello Michelle,
I just did something like this on a site I’m developing ( http://www.wocweb.sandwebdesign.nl/ ). But then I realized in this way a large (full width) image is loaded. So now I think it would be a better a idea to restyle the grid style blog module. In this way smaller images are loaded.
I will try it out later…
No sure why its doing that on your site as min load a thumbnail
Hello Michelle. This is a fantastic tutorial. I noticed that the “read more” button does not behave well on the mobile devices (by being set up as an absolute position and 440px from the left, it disappears from the screens of mobile devices). I have adjusted it to be positioned as relative and 1px from the relative item to the left). This makes the read more resize much cleaner on mobile devices. Hope this helps:
/*This styles the read more link*/
.ds-thumbnail-blog a.more-link {
display: inline-block;
position: relative;
left: 1px;
Hey thanks for adding that I am sure it will help people. This was fine when created but with Divi updates things do need to be adjusted every now and then
Hey Michelle, fascinated with your website/content. I’ve Just discovered and trying to read as much as possible. I really want to know how to setup a beautiful sidebar like you did (colored bars on the left of recent comments/popular). Another thing I am struggling to find is how to use featured images only on the Grid Page BUT remove from the blog post header. Any idea?
Thank you
Thanks Eduardo
I will look at creating some more sidebar styling recipes
To hide the featured image try this:
.single .et_pb_post .et_post_meta_wrapper img {
display: none;
}
This snippet does the magic…thank you!
I’m looking forward to read mode about sidebar styling recipes
See u
Hi Michelle,
I have completed all the steps, but the “post-title” and “meta-data” still appear over the image and not the right with the rest of the text.
What should I do?
My blog is still private, as I have not launched yet.
Unfortunately I am not able to help without a link to the problem Gabriel
Hi Michelle,
Thank you for all your hard work and support. You are awesome.
Is it possible to create the same layout for each category rather than having the posts stack above each other?
I am not entirely sure I understand what you want but you can create individual category layouts in a number of ways, this being the easiest and quickest https://elegantmarketplace.com/downloads/taxonomy-layout-injector/
Great post, it looks great on my blog. I want a divider between post and I notice the comment “For a divider you will need to look at using the :after pseudo element to add content between posts” what does that look like? Can I place it in the module in the “After” CSS box?
Something like this should work:
.ds-thumbnail-blog .et_pb_post:after {
content: '';
width: 100%;
height: 1px;
background: black;
display: block;
}
Hi Michelle,
Thanks for sharing (once again). This appears very nicely on the category page that I created and works perfectly
Welcome Cecile
Hello Michelle, thank you for this recipe!
I defined a blog page with this layout, but on top of that layout I added one blog-module with the full content.
So the first blog post will be on the blog post in full length.
http://www.wockensolle.de/
Comments are enabled, but this design does not show the comment function unfortunately.
How can I get comments working here and not only on the single-page?
Thanks in advance, Connie
Thank
Connie this isn’t the design, if your blog module at the top doesn’t use the custom classes of the recipe, then none of the settings will apply to it. So you will have to adjust settings for comments either in WP or Divi to dislay them for that post
Hi Michelle – Thank you for this! Do you know if it’s compatible with the current versions? I’ve been trying and can’t get the horizontal boxes to work (although the other styling seems to be adopted). It’s at the bottom of this page (still in development): Thank you for any insight you can provide!
Hi Jane, yes it is compatible I am running with the latest Divi version on the demo.
On your page, the layout it shows is not the one you have comments on?
Should the entire code be placed in one section of the Custom CSS? If so, which one? Thanks
All the CSS needs to go in the Child Theme Stylesheet, epanel or your page custom CSS box. I would go for the child theme stylesheet
Hi Michelle:
Fantastic post! Thanks for putting this out there for Divi users!
I had to change the image size to a smaller size as it looked too large. I am now getting to much white space between my 3 posts. How do I reduce the margin, and also add a divider line between posts?
URL:
You will want to change this section of CSS to be 250px
.ds-thumbnail-blog .et_pb_post {
background-color: #fff;
min-height: 350px;
margin-bottom: 50px;
}
For a divider you will need to look at using the :after pseudo element to add content between posts
Hi Michelle! Sadly, this recipe is not working when on mobile, it looks like the media queries are overlooked, don’t know why… Any suggestions what can be wrong? The code is OK I guess. Many thanks in advance!
Its working fine for me on mobile, do you have a link please?
Thank you! Worked well
This is great! This made my friend’s blog look so much cleaner.
My only issue is that her images are all horizontal and rectangular shape, and this code is zooming into a square image so it cuts off both sides of the image.
Any ideas how I can tweak it to show the images in a landscape look?
Thank you!
This is the section you will need to edit
.ds-thumbnail-blog .et_pb_post a img {
float: left;
width: 400px;
height: 350px;
object-fit: cover;
margin: 0 40px 0 0;
}
/*Resize the overlay to fit the image*/
.ds-thumbnail-blog .et_overlay {
width: 400px !important;
height: 350px !important;
}
The object-fit property is what crops the images so you can remove that and then play with the sizing of the image. You will also need to adjust it in the media queries
Actually I solved my own problem so no help required. Thanks. If anyone would like my solution for adding a default image to blog posts with no featured image, let me know.
Zachariah – I may need this, so please share your technique.
I have a challenge for you. This is a great tutorial and coincidentally was exactly what I was looking for. So. Perfect. Here is my challenge. I’m inheriting content from an old website. Many of the blog posts have no images attached to them, and no images are available. What I thought about doing is having a single, fixed image that appears if there is no image. I added this image into the media and used it as the featured image for the posting. In this case, it is just the company logo. While this works well on the page… Read more »
Hi Michelle, I’m confused about the METHOD – Here is what you need to add to your Child Theme Stylesheet, epanel or even your page custom CSS box. Can you tell me specifically, where to go in the Divi theme to add the css info and do I just copy and paste the whole thing, or, do I have to go somewhere in the theme, pull up a css sheet and make changes line by line? Sorry because I know that you are very advanced and some things you probably don’t think about things like, “where do I go to… Read more »
Hi Charlotte
No problem
In your wordpress dashboard go to Divi>Theme Options and then scroll down to the custom css box and paste everything in there, then save and voila. Hope that helps
Hi Michelle. one of my blog pages is just video. this code is not allowing the video to float left – do you have a suggestion as to how to do it.
The video is grabbed from youtube. I tried adding a featured image but this hasn’t helped – I actually don’t want the featured image on the single post
as the video is the feature element. This code did work for broadcasts, articles, blog and events.
Hope you have a solutions. I love the result.
Hi Lisa
I haven’t tried this with video but if you are using an embedded video from youtube then it won’t work as it will use an iframe. If I do get time I will try to take a look for you.
Hi Michelle.. thank you for the tutorial! It’s really good! However, I have 3 questions.. after using the method I only see the top most post being effected in terms of font and font size..rest of them dint change.. 2. I don’t want the spacing between each posts.. Can that be reduced somehow? I tried but couldn’t .. pls help.. Pls see the blog here – http://ksim.org/blog/… 3. I was looking for a layout like the one in this site – http://www.aholyexperience.com/.. You see the posts featured images come on the alternate sides and there is no spacing between each… Read more »
Hi Elina
Its look like you got your blog issue sorted?
In terms of the alternating left and right images, that would take quite a bit of PHP editing which unfortunately is currently above my pay grade
I can recommend a couple of really good PHP developers if you are looking to hire someone to achieve it.
Hi Michelle. Thanks so much for this! I just LOVE all the stuff you put out, really helpful! I just have a question of further implementation – how to use this effect for the categories pages? This is the Home page: Categories: Still in development phase. Thanks! CSS I used for the blog: /*Styling for the posts*/ .ds-thumbnail-blog .et_pb_post { background-color: #fff; min-height: 600px; margin-bottom: 50px; padding: 20px 20px 30px 20px; } /*Sets the image size posts and moves it to the left of the text*/ .ds-thumbnail-blog .et_pb_post a img { width: 670px !important; height: 400px; object-fit: cover; } *Resize… Read more »
Hi Tina
This won’t actually work on category pages as they use the default settings and you don’t have access to assign custom classes. It can be done but you would need to edit some PHP files
Michelle, is there any way to make the read more button appear flush to the left of the title/excertp on mobile and tablet? Looks
like it is drifting to the middle underneathe the excerpt on devices. Desktop looks perfect!
Its working fine for me Ross, which device and do you have a link please?
rossbegbie.com on mobile and tab the read more button floats to the right. here is the code i use: /*Styling for the posts*/ .ds-thumbnail-blog .et_pb_post { background-color: #fff; min-height: 350px; margin-bottom: 50px; } /*Sets the image size posts and moves it to the left of the text*/ .ds-thumbnail-blog .et_pb_post a img { float: left; width: 400px; height: 350px; object-fit: cover; margin: 0 40px 0 0; } /*Resize the overlay to fit the image*/ .ds-thumbnail-blog .et_overlay { width: 400px !important; height: 350px !important; } /*Stack the image and content on smaller screens*/ @media only screen and (max-width: 980px) { .ds-thumbnail-blog .et_pb_post… Read more »
Can i have a link please Ross
rossbegbie.com
You just need to change your margin for the button in the media query
@media only screen and (max-width: 980px) {
.ds-thumbnail-blog a.more-link {
margin: 20px 0 30px 30px;
}
}
I have adjusted it as so:
.ds-thumbnail-blog .et_pb_post h2 {
margin: 0px 0px 0px 0px !important;
}
.ds-thumbnail-blog .et_pb_post p {
margin: 0 0px;
}
Does not seem to be displaying as wide as the featured image on mobile?
…and also to change the read more button to “open sans”! =) thanks for all of your help!
I resolved the width issue thank you, but would just like to know how to set the read more button text to open sans font in the coding? reason for putting it in code instead f changing font in divi is because I want the meta data (date/category) to show as open sans but the excerpt to show as Lora font (because it is body text). =)
Hi Ross
yes just add
font-family: ‘your font’; to the css for the a.more-link
I seem to have resolved this one here =)
Michelle
Great Thanks, I try to do this since 3 month….
Restult is so fun (I adapt CSS to my design) http://blog.laplateformedelarenovation.fr/
That looks great, thanks so much for sharing
Hi Michelle, Thanks so much for the tutorial. I’ve used it for my blog and am very happy with how it looks. The only problem I have is when I view it on a smaller screen (or mobile device) the featured image gets bigger and it doesn’t look good. Do you know how I can fix it? Thanks
Hi Steve, all sorted via FB
Hi Michelle, I a wondering how to fix the issue via mobile as well. The featured image looks huge!
Hi Ross The media query sets he image size for mobile so you can amend this CSS to make it whatever size you want: @media only screen and (max-width: 980px) { .ds-thumbnail-blog .et_pb_post a img { width: 100%; height: 500px; object-fit: cover; margin: 0 0 40px 0; } /*Resize the overlay on smaller screens*/ .ds-thumbnail-blog .et_overlay { width: 100% !important; height: 500px !important; } .ds-thumbnail-blog .et_pb_post h2 { margin: 40px 30px 20px 30px !important; } .ds-thumbnail-blog .et_pb_post p { margin: 0 30px; } .ds-thumbnail-blog a.more-link { margin: 20px 0 30px 30px; } }
Thank you, and lastly, how do I make the width of the excerpt, title, and meta be as wide as the featured image on mobile?
Thanks again.
Adjust this part of the CSS I posted peviously:
.ds-thumbnail-blog .et_pb_post h2 {
margin: 40px 30px 20px 30px !important;
}
.ds-thumbnail-blog .et_pb_post p {
margin: 0 30px;
}
Awesome, thank you for this recipe! Exactly what I was looking for – I just switched to Extra just because of the blog layout…
Welcome Nick