• Resolved DrUltraLux

    (@gaiyamato)


    I just need to replace this line:

    <?php the_post_thumbnail( 'single-post-thumbnail', array( 'class' => 'single-post-thumbnail' ) ); ?>

    With one that uses the same style element (single-post-thumbnail), but always only returns the default image set using your plugin.

    My posts have a featured image I use for a widget, but I am using the featured image for the page header for every page/post etc. (from another plugin), so I want to always only show the default image for posts only.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jan-Willem

    (@janwoostendorp)

    Hello Gaiyamato,

    I’m sorry but I don’t understand your question. Do you want the Default Featured Image(DFI) only in the widget, or only in the header?

    Thread Starter DrUltraLux

    (@gaiyamato)

    I want the default image to only always show at the top of the posts pages.

    So in the header. I already have a plugin/theme that puts the featured image as the header for the page.

    Basically we set a 150px x 150px featured image on posts, which then displays in the wiki. However when you view the post you get a distorted mess at the top, we want to keep the current featured image for posts but only display the default image at the top when you view them.

    Thread Starter DrUltraLux

    (@gaiyamato)

    Here is an example post on the site in question.

    https://www.kingdomofaequitas.com/uncategorized/final-testing/

    I want the animated gif at the top replaced by our default featured image instead.

    I just need to know how to spit out the set default featured image is all.

    • This reply was modified 7 years ago by DrUltraLux.
    Plugin Author Jan-Willem

    (@janwoostendorp)

    Interesting use case.

    The best way is to replace the line with:

    <?php echo wp_get_attachment_image( get_option('dfi_image_id'), 'single-post-thumbnail', false, array( 'class' => 'single-post-thumbnail' ) ); ?>

    There is a wayto do it without touching the theme files but It will be very long and complicated.

    • This reply was modified 7 years ago by Jan-Willem.
    Thread Starter DrUltraLux

    (@gaiyamato)

    Ah that makes sense! I had tried a couple of things similar but didn’t think of doing it that way!

    Thank you very much, works perfectly. ??

    I gave your plugin a 5 star rating the other day, if I could I’d give you a second one for this alone! ^_^

    Plugin Author Jan-Willem

    (@janwoostendorp)

    I saw that.
    Marking this topic as resolved is enough for me ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Always show default image on single’ is closed to new replies.