• Resolved icec

    (@icec)


    Hello,

    I would like to remove the header and footer from a single page.

    I have tried various options, adapting previous answers from this forum and with various combinations of scripts, but I am stuck and would really appreciate some help.

    Do I need to change the header.php or the page.php? or something else?

    Many thanks in advance.

Viewing 15 replies - 1 through 15 (of 23 total)
  • You’d need to edit header.php and footer.php. Use the is_page() conditional to determine what is, or isn’t, shown on this particular page.

    Thread Starter icec

    (@icec)

    Thanks so much for replying. I think I was stuck on whether I needed to edit the page.php too. After hours of trying more complicated things, your answer just made it all click. Simple! I did it and it worked. Thanks so much and all the best.

    Shea

    (@shea-wordpressorg)

    If you edit header.php and footer.php, won’t that affect ALL pages? How do you limit it to just one page?

    Shea

    (@shea-wordpressorg)

    So I figured out what my page_ID is, now what? What is the code to hide the header and category bar? Also, does it matter where this line of code is entered in the header.php? I assume it needs to be near the top… perhaps just below the W3 line?

    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?>>
    is_page(‘174’)

    Thanks in advance for your help. 🙂

    Shea

    Shea

    (@shea-wordpressorg)

    Well, I discovered that’s not where it goes… 😉

    if you could copy the code of your header.php into a pastebin and post the link here, someone might have a look at it and might be able to help you.

    wp_list_categories(‘title_li=’); in sidebar.php for hiding categories and wp_head header.php

    Shea

    (@shea-wordpressorg)

    Thanks for the advice. My header is here http://wordpress.pastebin.com/m542f429c

    Thanks ‘magickman’, but I’m not sure exactly what you mean. I found wp_head(); was I supposed to put it in the parentheses like this?

    wp_head(wp_list_categories(‘title_li=’)) because that didn’t work and in fact, put a link to my category in the header. (I said I’m a total newbie to PHP). I’ve asked a developer I know to take a look at it and see if he can get it to do this.

    Thanks again to both of you.

    Shea

    Cyberbronco

    (@cyberbronco)

    I am trying to do the same thing: remove header from one page. Previous posters ended up answering their own questions without documenting the answers here.

    Can anyone hold my hand through this? I know how to get to the appearance editor and open the header.php file to edit it and I know my page id that i want to do this on. After that I am lost on this one.

    Thanks in advance.

    Jeff

    elizool99

    (@elizool99)

    Jeff

    use a function that checks page’s id then make a IF condition in PHP that if the page’s ID isnt not the id of the page u dont want to show the so the header will be shown
    u need to type != in the IF so its says not equal because if the ID not equal to the id of the page the header will be shown

    do it in header.php

    Cyberbronco

    (@cyberbronco)

    Elizool99,

    You lost me already.

    I know my page #.
    I vaguely understand what you are talking about.
    Can you give me the code and where I would write it in the header.php?

    Thanks so much for responding so quickly.

    Jeff

    Cyberbronco

    (@cyberbronco)

    Here is the page I am working on. If you click on any of the gallery images below the header they will pop up behind the header image when viewed in IE. Grrrr!

    Jeff

    elizool99

    (@elizool99)

    1.u have fatal error i cant see ur site
    2.i dont understand what do u want to do u know page id and how to edit header

    Cyberbronco

    (@cyberbronco)

    Elizool99,

    You peeked while I was experimenting. Unfortunately I still cant get it working. I restored my site. It’s back up.

    What I don’t understand is what to write in the header.php. My page id=10.

    Can you tell me what to write and where to place it?

    Thanks so much.

    Jeff

    elizool99

    (@elizool99)

    what to write so the header wont display on page id 10?
    if yes
    make if in php to the page id and if its equlals 10 so header wont show and else
    he will be shown

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘How to Remove header and footer from a single page?’ is closed to new replies.