Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 class large.

    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 class large?
    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 10 years ago by Marc Bijl. Reason: Added some example links and code snippets to illustrate the issue
    #367806

    Hi 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,
    Josue

    #367813

    Wow, 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?

    #367837

    Hi!

    I’d suggest changing the size of the ‘large’ image size with the Simple Image Sizes plugin.

    Best regards,
    Josue

    #367960

    Hi Josue,

    Thnx, excellent support!

    Cheers,
    Marc

    #367972

    You are welcome Marc, always glad to help :)

    Regards,
    Josue

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Css class for featured image different per post format?’ is closed to new replies.