Support » Themes and Templates » Removing Twenty Eleven Title Image for Static Page

  • Resolved tdmac


    Hello all,

    I have added a static page by creating a new php doc called “page-static-tdmac.php” derived from the “page.php” available in my Twenty Eleven Templates. (I have created a child theme for my css styling, btw.)

    Anyway, I stripped it down taking out comments etc., but I’m not sure how to lose the uploaded header image, which I DON’T want to appear on my static page. I have another graphic I want to use for this page.

    Because I DO want the header images available on other pages, it doesn’t seem like altering the css styling, is the solution as that will affect all occurrences of my header?

    I’m not sure how to remove or alter the appearance of my header image for this page specifically.

    This is the site:

    Please forgive my non-proficiency. I’m new to wordpress, so in your replies if you could speak in layman’s terms (while I do have some understanding of css and html), that would be appreciated! Thanks!

    Here’s the php template I created for my static page:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

Viewing 9 replies - 1 through 9 (of 9 total)
  • hi,
    if you want to remove header image only from your StaticPage tamplete then you can do so .the only thing with this solution is that all images get hide(might be you logo or menu image which you used)but as i check you website , you use css to add logo to your website not img tag so it will work.try it.good luck.

    	Template Name: StaticPage
    .remove img{display:none;}
    <span class="remove">
    <?php get_header(); ?>
    		<div id="primary">
    			<div id="content" role="main">
    			</div><!-- #content -->
    		</div><!-- #primary -->
    <?php get_footer(); ?>



    Forum Moderator

    how to lose the uploaded header image, which I DON’T want to appear on my static page. I have another graphic I want to use for this page.

    possibly try and use this other graphic as ‘featured’ image for that page – any featured image – if at least 1000*288px – will get used as header image for single posts or static pages.

    Thank you so much, ravinderk. I think that worked! I soooo appreciate the response. Now, I’m off to see if I can add the image I do want to use for my static page. Hopefully, I won’t run into any problems.

    Thanks again!

    Well, hmmm… seems as though the “.remove img” is definitely causing all images within primary to be hidden. So, when I add an image using css “background: url)’…’)” it won’t show up. I’m playing around with it to see what other method I might employ. I added a div to house the image. But perhaps I need to try an href. I’m trying to work it out… Will let you know.

    sorry. not an href…

    So far, no luck. I tried setting the image I want for the splash page via “featured image” on from the pages menu in my dashboard. I still have the code from ravinderk in my custom php doc, which is great for getting rid of all images, but I can’t seem to figure out how to just get rid of my header image alone.

    Can I say something in the code that essentially says, “ignore this specific file name”? Or tell it to not load the header.php doc? Or something along those lines?

    This seems to be so simple, yet I’ve gotten myself so confused. Any help appreciated in advance.



    Forum Moderator

    remove that extra code;

    to ‘hide’ an image with css on any specific page, use the css class output by body_class() together with the specific selector for the image;

    example to hide the header image in a static page with the page template ‘page-static-tdmac.php’:

    .page-template-page-static-tdmac-php #branding img { display: none; }

    try to get familiar with using a tool such as Firebug to investigate these kind of formatting problems.

    you can target specific header,if you want to remove header image then give an css id to it.(header.php)
    for example

    [ Code moderated. For more than 10 lines of code please instead. ]

    and in static template:

    [ Code moderated. For more than 10 lines of code please instead. ]

    hope thisone work for you.gud luk

    Thank you soooo much, alchymyth. That totally solved the issue. I’m rapidly trying to familiarize myself with all things code and how to manipulate wordpress to my advantage! And have definitely been using firebug. I think I run into trouble with the basics of css, html. Plus, I’m at the bottom of the curve in my understanding of php!

    I very much appreciate the help both of you have given me. I can’t wait to learn more and be able to pass my knowledge onto others in the forums as you have done for me. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Removing Twenty Eleven Title Image for Static Page’ is closed to new replies.