• My pages have the header images but I do not want these on my posts when clicked from the Home page, since the standard images do not relate to the post topic and can be confusing to readers. How do I set it up so that the posts do not have this image? Also, how do I set it up so that the post comes up in target=_blank?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This CSS snippet may to the trick:
    #branding > a { display: none; }

    That snippet should go in style.css.

    Start with the CSS. However, if there are other links at the very top level of your header, it will hide those too. In that case you may need to edit header.php, line 99 by default, and change this:
    if ( is_singular() && has_post_thumbnail( $post->ID ) &&

    To this:
    if ( (is_page() || is_attachment()) && has_post_thumbnail( $post->ID ) &&

    That last snippet is untested, but should work. It’s a good starting point for plan B in any case.

    For target="_blank", I would try changing content.php, line 19, from:
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    to
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" <?php if ( is_home() ) { echo 'target="_blank"'; } ?>><?php the_title(); ?></a></h1>

    Again, that’s untested, but it should work, and is a good starting point otherwise. I’m not used to working in older themes like this, and have no testing servers spun up to test at the moment :-/

    Hope that helps though!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Want no header image for posts in TwentyEleven’ is closed to new replies.