• I have two areas within my site that use the Posts layout… Press and Blog.
    When visiting Press it looks like this… https://snag.gy/0DFwZq.jpg
    When visiting Blog it looks like this… https://snag.gy/iUWdqv.jpg

    Not only do the regular posts have a different sized featured image on Press and Blog, the Blog requires the first post and featured image to be full width.

    I’m using the WooThemes Canvas Theme and within the options, I normally set the featured image size… https://snag.gy/SIFda5.jpg
    With needing variable sizes, this is useless to me.
    I’ve currently turned off Dynamic Image Sizing and Hard Crop, so that I can acheive the layout short term, but this is only working because I’ve uploaded images that have been cropped to size in the PSD provided to me.
    Long term, I’m going to end up with results like this… https://snag.gy/GrcjFN.jpg

    I need a solution that is going to work when the user uploads a regular sized image.
    As far as I can tell, the only way to acheive this, will be to have the featured image being pulled in as a background image, which I can set to cover.
    I’m not keen on this idea, as elements with background images won’t respond on smaller devices, as easily as a normal image would when using width 100% and height auto.

    I could do with someone pointing my in the right direction or if anyone knows of a plugin that will help me acheive this, please let me know what it is.

    Thanks,

    Kirk

Viewing 4 replies - 1 through 4 (of 4 total)
  • As per the Forum Welcome, you should really be asking for assistance from where you purchased the theme, they may have a dedicated support area with people who own the theme as we’re not provided commercial products.

    Thread Starter kwebdesign

    (@kwebdesign)

    Sorry, I thought the hack would have been un-theme related.

    Moderator bcworkz

    (@bcworkz)

    It’s actually sort of half and half. If you were to quickly re-read your original post while ignoring your prior knowledge of it, I think you will see how it could be taken as a strictly theme related issue.

    You can add specific image sizes to suit your needs with add_image_size(). This can be done from a site specific plugin you create or from a child theme. That part is not theme related.

    Then each template for each post type should specify the desired image size when the_post_thumbnail() is called to display the featured image. This of course is theme related, but you can customize theme templates by copying them to your child theme and editing the child’s copy.

    A possible non-theme approach would be to use the ‘post_thumbnail_size’ filter to cause your added featured image size to be used, except there’s no way within the callback to know which template called the_post_thumbnail() to know which image size to set. Thus the filter callback that returns a particular size would need to be selectively added depending on what template is being used. You may be able to do so within a callback to ‘template_include’.

    Thread Starter kwebdesign

    (@kwebdesign)

    Thanks for your reply…

    My best option is going to be using custom built templates against a Blog and Press page then, instead of trying to acheive both layouts from the standard post archive template.
    I thought this might be the case, but wanted to check I wasn’t making life difficult for myself.

    I’ve also recently learnt about https://css-tricks.com/almanac/properties/o/object-fit/

    Regards,

    Kirk

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple Post Featured Image Size’ is closed to new replies.