The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Disable Featured image header in Twenty Eleven? (8 posts)

  1. Michelleas
    Posted 3 years ago #


    I've set a custom header, but I've just discovered that the use of the featured image function overwrites the header on single posts/pages. How do I prevent that from happening? I want to keep the same header on all pages.
    I'm hoping to use the featured image function for a popular posts plug-in.
    I've tried searching the forums and found this: http://wordpress.org/support/topic/twenty-eleven-disable-featured-image-in-header?replies=7 however I can't seem to get any of the suggested fixes to work with my blog.
    Here's a link to a page with the unwanted featured image as the header: http://sweetsuite10.com/2012/08/im-honoured/


  2. mokah
    Posted 3 years ago #

    Create a child theme for Twenty Eleven and take out the code that selects the featured image in the header.php and just manually put the code for the image you always want there. Then, when you select a featured image for a post, the header won't change but you can still use the featured image in other areas of your website.

    Edit: Check this out.

  3. Michael
    Forum Moderator
    Posted 3 years ago #

    can't seem to get any of the suggested fixes to work

    what exact code have you tried?
    what was the result?
    any error messages or warnings?

  4. Michelleas
    Posted 3 years ago #

    Hi guys,

    I do have a child theme, however I'm VERY new to php so modifying the header file is rather confusing.
    As to which codes I've tried - I tried BlueJPro's code however my line 92 doesn't look like //echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); it just says <?php
    Alchymyth's suggested code didn't work either.
    I'm confused by Erikoliv's suggestion as my php seems to be several lines longer than his - mine starts at line 78?
    I'm wondering if the problem I'm having is my php makes reference to '// Compatibility with versions of WordPress prior to 3.4.' Perhaps the fixes I tried don't work with the version I'm using which is 3.4.2

    Also, I don't get any error messages - the featured image just remains as the header which is not what I want.

  5. Michael
    Forum Moderator
    Posted 3 years ago #

    can you post the full code of header.php (including with any edits) ?

    please use the http://pastebin.com/ - see http://codex.wordpress.org/Forum_Welcome#Posting_Code

  6. Michelleas
    Posted 3 years ago #

    Hi Alchymyth

    Here it is: http://pastebin.com/mwB2UZ6z

  7. Michael
    Forum Moderator
    Posted 3 years ago #

  8. Michelleas
    Posted 3 years ago #

    Thank you SO much Alchymyth - that seems to have worked :)

    Your assistance is very much appreciated :)

Topic Closed

This topic has been closed to new replies.

About this Topic