Support » Plugin: Unique Headers » How to call in template

  • Hi and thank you for your great plugin. It seems to work very well however I want to display the header image in my custom template and I can’t get it to work as needed. I want to show the header image in the category / page and if the header image exists display the image or otherwise the title. Can someone advise how to accomplish that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ryan Hellyer


    If you haven’t gotten the WordPress header image functionality working in your theme, then that is the first task you need to accomplish. Once that’s working, the Unique Headers plugin should simply start working automatically 🙂

    If the WordPress header image is working, but the plugin still doesn’t function, then I’d need to see the code to figure out what might be wrong.

    Thank you very much, I can see it now! Is there any chance to display it in Custom Post Types?

    Plugin Author Ryan Hellyer


    No, although I should add a filter to allow you to add support for that via another plugin. I’ll try to remember to do that in a future version.

    In the mean time, you could open up the index.php file of the plugin and add an extra two lines at the bottom for your custom post-type. That is not an ideal solution though and you would need to avoid upgrading the plugin if you did it.

    Thanks I will try. Can you give me a hint how do I call it in my CPT?

    Plugin Author Ryan Hellyer


    At the bottom of the index.php file in the plugin is this code:

    $args['post_type'] = 'page';
    new kdMultipleFeaturedImages( $args );

    You would need to replicate that, but with a different post-type instead of “page”.

    So you’d copy the two lines and paste them below, but change where it says “page”.

    This is a hacky way of doing it, but it should work. You may also want to change the plugin folder name and the name at the top of the index.php file, to avoid WordPress asking you to upgrade it (which would wipe out your changes).

    You may also be able to hook in at init and add it via a theme or plugin there, but I’m not certain. I’m also not promising that would work in future versions either, as I may modify the way that part of the plugin works in future as it doesn’t look like I did a particular great job of it originally (ie: it doesn’t let you easily add custom post-types in it’s current form).

    Sorry to bump up an “old” topic but I have added the code at the bottom of the index.php file and changed ‘page’ to ‘te-koop’, the name of my custom post type. I now have the custom header box in my custom post type but it doesn’t show up on the page. Everything looks just fine in the backend but not on the frontend.
    It works just fine on my other, regular, pages. Can you maybe have look at it and tell me what I did wrong? My site is at and the page I am talking about is The brown/black horse in the header is the standard/default header image but it should display the horse from the slideshow at the bottom of the page. Same goes for


Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to call in template’ is closed to new replies.