-
AuthorPosts
-
May 3, 2023 at 10:11 pm #1406392
We’ve been using the Enfold theme for several years, but there’s a change I’d like to make. We’re using Blog Single Author Fullwidth for what we call Memos, and the 1210 x 423 image is just too hard to work with—very few stock images are that shape, so I end up spending hours making images wider. We use 1200 x 630 in other applications and would like to change the blog’s image size to that.
Obviously, it will be easy to upload the new size for new posts, but we have over 1,100 blog posts—it’s going to take a while to change them all.
In the meantime, I want to set rules for how to use the old wider images in the new space: I don’t want the image to be distorted, just stretched to 630 deep and clipped on the ends (instead of holding the width the same and vertically stretching the image from 423 to 630, which is what it seems to want to do, or floating the image with mandatory white space on the sides).
I think some shortcode will fix this, but I don’t know what that would be. Help!
May 4, 2023 at 8:06 pm #1406480Hey joneszelasko,
Thank you for your question, as I understand your question you would like to change the size of your featured image in your posts to 1200 x 630,
You can do this with this code to the end of your child theme functions.php file in Appearance ▸ Editor:add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 ); function enfold_customization_modify_thumb_size( $size ) { $size['entry_without_sidebar'] = array('width'=>1200, 'height'=>630, 'crop' => true); return $size; }
Then use the plugin Regenerate Thumbnails to resize the images.
Please note that the code above sets the crop to “true” and I believe this is correct for your situation, but if not try changing it to “false” and regenerate the images again.Best regards,
MikeMay 12, 2023 at 12:56 am #1407161We tried that (both ways) and nothing changed. We don’t use a child theme–could that be the problem?
If we can’t get that to work, is it possible to leave all the posts already online on the old template and use a new template for all new posts?
May 12, 2023 at 11:46 am #1407222Hi,
This should work fine in the parent theme functions.php, but it will be lost when you update, we recommend using a Child Theme for customizations.
Then you also need to Regenerate the Thumbnails for the change to show, did you also do this?
Perhaps creating a staging site to test with would be a good idea, then you can apply it you your live site. Most cPanel webhosts have a staging site option, some in the dashboard:
Others add the option in the Softaculous WordPress Management
There may be other staging site options in different cPanel servers, these are the two that I have seen.
Please include an admin login to the staging site in the Private Content area so we can check.Best regards,
MikeMay 16, 2023 at 9:22 pm #1407660What about my second option: is it possible to leave all the posts already online on the old template and use a new template for all new posts?
May 20, 2023 at 10:12 pm #1408030Hi,
Thank you for your patience, to change your current post image to 1200px x 630px without stretching them, try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top.single-post .fullsize .template-blog .big-preview img { width: 1200px; min-height: 630px; object-fit: cover; }
After applying the css, please clear your browser cache and check.
Best regards,
MikeMay 24, 2023 at 10:40 pm #1408473We added that code, but it’s not working correctly. The image isn’t responsive (if that’s the right word); when the page is made smaller, the image stays the same height and the width is cropped, which gives some weird results. Pages with the old size images don’t work either; somehow it ends up 1030 x 360 instead of 1210 x 423, so the image is cropped all around. I’m starting to lose hope.
Maybe a better approach is to create a second template with the 1200 x 630 image size. Is that possible?
May 25, 2023 at 6:15 am #1408485Hi,
To adjust the style of the slider on smaller screens, you can include a CSS media query and adjust the values in the CSS rule provided above. Here’s an example:
@media only screen and (max-width: 767px) { /* Add your Mobile Styles here */ #top.single-post .fullsize .template-blog .big-preview img { width: 1200px; min-height: 430px; } }
Feel free to experiment and customize the values according to your specific design preferences and requirements.
Best regards,
IsmaelMay 31, 2023 at 5:35 pm #1409159I still don’t have an answer to my question: Is it possible to leave all the posts already online on the old template and use a new template for all new posts?
June 1, 2023 at 4:01 am #1409233Hi,
We apologize for any confusion. By default, all posts, whether new or old, will use the same template. However, it is possible to modify the template to display different elements for different posts, but this would require customizations that are beyond the scope of our support.
If you require such customization, we recommend hiring a freelancer who specializes in theme customization. You can find experienced freelancers who can assist you by visiting our customization page.
If you have any additional questions or need further assistance, please don’t hesitate to reach out to us. We’re here to help.
Best regards,
IsmaelJune 1, 2023 at 5:50 pm #1409295Okay, thanks for clearing up that issue. In that case, I just want to leave the template as it was, but change the image from 1210 x 423 to 1200 x 630 for all the memos, old and new, and let the chips fall where they may. The old size was working just as we wanted it to, getting larger or smaller depending on the screen size without distortion, so I want to undo all the recent changes. What’s the best way to do that?
Second question: at the bottom of our product pages, there’s a tab that says Description and then under that it says Description again. How do I get rid of the second one? Link below.
June 2, 2023 at 7:10 am #1409356Hi,
In the filter that we provided above, you will have to adjust the height value from 630 to 423
add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 ); function enfold_customization_modify_thumb_size( $size ) { $size['entry_without_sidebar'] = array('width'=>1200, 'height'=>430, 'crop' => true); return $size; }
After the adjustment, use the following plugin to regenerate the thumbnails. Please make sure to create a site backup or a restore point before using the plugin.
// https://wordpress.org/plugins/regenerate-thumbnails/
Thank you for your patience.
Best regards,
IsmaelJune 6, 2023 at 8:06 pm #1409800Second question: at the bottom of our product pages, there’s a tab that says Description and then under that it says Description again. How do I get rid of the second one? Link below.
June 7, 2023 at 1:56 pm #1409884Hi,
Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top.single-product .woocommerce-Tabs-panel--description > h2:first-child { display: none; }
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
After applying the css, please clear your browser cache and check.Best regards,
MikeJune 23, 2023 at 9:32 pm #1411518We still haven’t been able to get the size of the blog post images changed. Could you please take another look at it and tell us what short code we could add that would change the image from 1210 x 423 to 1200 x 630 without changing the way the image adapts to the screen size? (Both the height and width change proportionally to the screen size without clipping the image.) Thanks.
June 25, 2023 at 9:24 pm #1411653Hi,
When I examine the featured image for the post you linked to, it looks like the full size image that you uploaded is 1210 x 423. I checked a few others and they all seem to be the same size. So the issue is that you want the images to be 1200 x 630 but WordPress can not make the height of the images larger. If the original image had been 1802 x 630 (or a similar ratio) then the then the scripts above could have made it 1200 x 630 without cropping.
Since you have 1100 blog posts the only solution I can offer is to use css to stretch your images taller:#top.single-post .fullsize .template-blog .big-preview img { width: 1200px; min-height: 630px; }
Best regards,
MikeJune 25, 2023 at 10:40 pm #1411660We’re planning to replace all of the images with the new size (yes, all 1100 of them.) If the old size images look weird until I get them all replaced, that’s just something we’ll have to live with. If this short code will enable the site to show the 1200 x 630 images correctly, then that is what we need. Does this sound right to you? Are we good to go?
June 25, 2023 at 10:47 pm #1411661Hi,
I believe this will work for you, please try adding the css to your Enfold Theme Options ▸ General Styling ▸ Quick CSS field#top.single-post .fullsize .template-blog .big-preview img { width: 1200px; min-height: 630px; }
Best regards,
MikeJune 26, 2023 at 10:45 pm #1411773Okay, I changed it and regenerated thumbnails, but it’s not working right. As the size of the page changes, the width responds but the height doesn’t. I’m getting some weird images, especially on my phone or tablet, as the images are compressed sideways. How can we change it so the height responds along with the width?
June 26, 2023 at 10:47 pm #1411774p.s. I replaced all the images from January 1 on, so they’re the right size images, it’s just not working like it did with the old size images where the height and width responded together.
June 28, 2023 at 1:06 am #1411897Hi,
Thank you for your patience, I checked the page below in the Private Content area and I see that the image size has been changed, the issue now is the css that I gave you when the image size was smaller, please look in your Quick CSS and remove this css:#top.single-post .fullsize .template-blog .big-preview img { width: 1200px; min-height: 630px; }
it is not needed with the new image sizes.
Best regards,
MikeMarch 2, 2024 at 9:55 pm #1436077Everything was working exactly as we wanted until the latest update. Now images have reverted to 1210 x 423 instead of 1200 x 630 (link to latest post below). The code you gave me is still in the quick css file, but something seems to be overriding it. How can I fix this so it’s working correctly again?
Code:
add_filter( ‘avf_modify_thumb_size’, ‘enfold_customization_modify_thumb_size’, 10, 1 );
function enfold_customization_modify_thumb_size( $size ) {
$size[‘entry_without_sidebar’] = array(‘width’=>1200, ‘height’=>630, ‘crop’ => true);
return $size;
}- This reply was modified 8 months, 3 weeks ago by joneszelasko.
March 2, 2024 at 10:04 pm #1436079Hi,
Thank you for the link to your page, I don’t find the above css in your site css, and when I test bu injeting it in the browser it works, perhaps there is an error in your css like a missing bracket that is breaking it, try add the css to your WordPress ▸ Customize ▸ Additional CSS and see if that helps.
You could check your custom css for errors with this tool.Best regards,
MikeMarch 2, 2024 at 11:36 pm #1436096Thanks for the quick reply. The Lint tool gave me a bunch of parsing errors for this code, saying it was unexpected. Does that mean it’s in the wrong order? I can’t understand why it was working, then we updated, and now it’s not working.
When I go to Theme Option, General Styling, I have a bunch of stuff in the Quick CSS (see below). Are you saying you don’t see the info there?
March 3, 2024 at 12:29 pm #1436118Hi,
Perhaps I read your question too quickly, I was looking for the css in the June 28 2023 post and this css in not in your Quick CSS.
But this code that is in your Quick CSS doesn’t belong there:add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 ); function enfold_customization_modify_thumb_size( $size ) { $size['entry_without_sidebar'] = array('width'=>1200, 'height'=>630, 'crop' => true); return $size; }
It belongs in your child theme functions.php file, but you are not using a child theme so it was probably in your Enfold functions.php and when you updated it was lost along with any other customizations.
If you are not going to use a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
then add the code and save and you won’t lose it on updates.
Remember that for any new images that you added you will need to Regenerate the Thumbnails for the change to show.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.