Tagged: featured image
-
AuthorPosts
-
December 13, 2014 at 11:04 pm #367798
Hi!
I used to enter all my posts as a ‘standard’ post format.
In that situation I wanted to change the size of the featured image to make it retina ready. So I defined the size for
entry_without_sidebar
to 2060×687 pixels, which worked great!However, now I split my posts up into standard post format (for my personal blog) and image post format (for my photo blog). Now suddenly the class
entry_without_sidebar
is not used anymore for the image posts. Therefore the definition of 2060×687 pixels is not used too. Instead, the featured image gets the dimension of 1030×343 pixels. As far as I can see this is set by the classlarge
.This is a standard post:
http://marcbijl.nl/persoonlijk/hallo-wereld-blog-marc-bijl
The code of the featured image is:
<img class="attachment-entry_without_sidebar wp-post-image" ... etc ...>
This is an image post:
http://marcbijl.nl/fotografie/lichtstrepen-texaco-station-nacht-foto-baneheide-nederland-panorama
The code of the featured image is:
<img class="attachment-large wp-post-image" ... etc ...>
Why is that? Why do featured images of standard posts use class
entry_without_sidebar
while featured images of image posts use classlarge
?
I think it’s confusing… And most important: what is the best way to get al my featured images at a size of 2060×687 pixels?Cheers,
Marc- This topic was modified 9 years, 11 months ago by Marc Bijl. Reason: Added some example links and code snippets to illustrate the issue
December 13, 2014 at 11:17 pm #367806Hi Marc,
Open /enfold/includes/helper-post-format.php and look for line 169:
$prepend_image = get_the_post_thumbnail(get_the_ID(), 'large');
Replace it by this:
$prepend_image = get_the_post_thumbnail(get_the_ID(), 'entry_without_sidebar');
Regards,
JosueDecember 13, 2014 at 11:24 pm #367813Wow, that was a blazing fast reply Josue, thnx mate!
Allright, two questions then.
(1) If I use your solution in my child theme, do I need to copy the original helper-post-format.php file to my child theme’s folders, and change it there (keeping the file in a folder with the same structure – that is in the includes folder)?
(2) Is it also possible to set the width of the class ‘large’ to 2060×687 pixels by changing this in functions.php or by using the plugin “Simple image size’ (the plugin I also used to set the class ‘entry_without_sidebar’ to these dimensions)?
What option would you suggest/prefer?
December 14, 2014 at 1:46 am #367837Hi!
I’d suggest changing the size of the ‘large’ image size with the Simple Image Sizes plugin.
Best regards,
JosueDecember 14, 2014 at 2:39 pm #367960Hi Josue,
Thnx, excellent support!
Cheers,
MarcDecember 14, 2014 at 5:16 pm #367972You are welcome Marc, always glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Css class for featured image different per post format?’ is closed to new replies.