Support » Plugin: Default featured image » Always show default image on single

  • Resolved 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 janw.oostendorp


    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?

    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.

    Here is an example post on the site in question.

    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 2 years, 1 month ago by gaiyamato.
    Plugin Author janw.oostendorp


    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.



    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 janw.oostendorp


    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.