Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Chris Dillon

    (@cdillon27)

    Odd. What theme are you using? Try a default theme like TwentyFifteen temporarily.

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Any news?

    Thread Starter fasteddie10851

    (@fasteddie10851)

    Yes, success…. I switched to the twenty fifteen theme and it was there so I switched back to the theme I was using and it is now there. This is a clients blog so sorry for the delay. Thanks for helping and the suggestion!

    Same problem here. No featured image when using my own theme (based on Underscore). It appears when switching to TwentyFifteen, but goes away when switching back.

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Make sure your theme supports thumbnails. Look in TwentyFifteen’s functions.php for a solid example.

    Hm, it seems that the theme-support options for my theme (in functions.php) cancels out and overrides stuff that a plugin want to add. I’m not sure that is a desired behaviour – maybe a bug report should be filed with wordpress (however that is done)?

    I’m using custom posttypes in my theme, and some of them need thumbnail support and some don’t, so I have this in functions.php:

    add_theme_support( 'post-thumbnails', array( 'post', 'page', 'cpt1', 'cpt3', 'cpt4') );

    I guess that I have to add ‘wpm-testimonial’ to that array? Which doesn’t seem like a proper behavior – a plugin should be able to add itself to that array.

    Plugin Contributor Chris Dillon

    (@cdillon27)

    Well, this was a real eye-opener.

    First off, I discovered I am using a non-existent hook after_theme_setup for my add_theme_support call. The correct hook is after_setup_theme. In effect, whether testimonials had thumbnails was determined by the theme and/or other plugins.

    The fact that it has not come up until now is probably due to most themes calling add_theme_support( 'post-thumbnails' ) without arguments (like TwentyFifteen does) which enables thumbnails for all post types, including any created by plugins.

    Calling it with arguments saves, not appends, the arguments, as you mentioned. Subsequent calls will overwrite, and the last one wins. And the order seems to alphabetical: The Hemingway theme would be loaded before Strong Testimonials; Strong would be loaded before TwentyFifteen.

    The Codex does not mention this. It’s not really a bug but it’s not intuitive behavior either.

    So if my plugin had the correct hook, it may have disabled thumbnails for posts, etc. for any theme/plugin starting with A-R and the problem would have been discovered a long time ago. Wow :/

    I have a fix that I need to test thoroughly using the correct hook and that properly appends “wpm-testimonial” to the existing post types, unless it’s already global. That does not solve the alphabetical order issue though.

    In the meanwhile, add “wpm-testimonial” to your list and it should work.

    Thanks for your persistence.

    Amazing! And amusing. ??
    Sorry to cause you all this work. But you know what they say – The Reward For a Hole Well Dug Is a Bigger Shovel.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘missing featured image’ is closed to new replies.