![]() ![]() You need to add the following code to your child themes function.php file. With this method, we are going to disable the automatic cropping for featured images. featured image, Image optimization, thumbnail, WordPress. It needs to be labeled correctly by using the alt-text and renaming the file name. This way all of the featured images will have the same size for your blog page. The most important aspects of optimizing the featured image include using a relevant featured image of the right size and of good quality. When you upload a featured image for your post, Divi will automatically crop it. entry-featured-image-url Method 2: Stop Divi From Cropping Featured Images According to my own estimations, the best WordPress featured image size is 1,200 x 630 pixels. Then go to Divi > Theme Options > CSS and place the following snippet. Place in the CSS field the class mh-blog-16-9. Open the Blog module and go to the Advanced tab. That will work better because these images are getting cropped for landscape. I have created CSS snippets for the most commonly used aspect ratios:įor portrait sizes, I recommend doing the second method. We are going to change this aspect ratio with CSS. When using thepostthumbnail () or related functions, the ‘post-thumbnail’ image size is used by default, though a different size. When you upload a featured image Divi use an aspect ratio of 16/10 for this image. When a theme adds ‘post-thumbnail’ support, a special ‘post-thumbnail’ image size is registered, which differs from the ‘thumbnail’ image size managed via the Settings > Media screen. You will need to crop them yourself however this will give you a bit more control over the outcome of the featured image Method 1: Use CSS to change the aspect ratio of the featured images You only have to add a CSS class and a snippet and you’re done.įor the second method, we are disabling the automatic cropping in Divi. The first method is great if you have a ton of blog posts. Method 2: Stop Divi from cropping featured images.Method 1: Use CSS to change the aspect ratio of the featured images.The 2 methods I will be covering in this tutorial: In this tutorial, I will be covering 2 methods on how you can change the featured image size for Divi. Divi comes with tons of features but unfortunately, you cannot yet change the featured image sizes for your blog. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |