Header on Static Page only

I would like to see a header on the front page (static) only. How do I remove the header from all other pages?

JB

  • Jorgen Juel

    Hi @jbouwer,
    the simplest way to do this is to add if(is_home): to your page.php or similar, just before the code that loads your header file (in my case this is get_header():wink:. Then add endif; after the code.

    Then also remember to remove the code that loads your header from your other page files, like single.php, category.php etc.

    I think this will solve your problem, and hope I'm making myself understandable.

    --
    Jørgen Juel

  • Jorgen Juel

    Hi,
    Okey, so when I responded I thought you already knew quite a bit since you wanted to remove this header, sorry.

    What do you mean when you say you want to remove the header of a page? Because the solutions you see now will not work if you don't replace the header with sufficient code. By simpy removing the header the way I and eliott suggest your page will be "broken" (not displaying properly).

    If you mean to remove the "top part" of the page referred to as a header, I suggest using my method inside the header.php, where you would wrap the code you wish to exclude from your inner pages within the if( is_home() ): and endif;

    This code should be added to your theme file called header,php (in most cases).

    If you can provide a link to your website or at least let me know what theme you are using I can provide further assistance on what to do.

    I hope this helps or at leases clearifies some things.

    --
    Jørgen Juel

  • jbouwer

    Thanks Jorgen. The theme I use is called Reddie. See http://www.ve3erc.ca

    I had initially a problem that I could not find anywhere an Amateur Radio theme. So I used a picture that I took some time ago. Then I noticed that the picture took up half the page space height wise. Then I found about about the required pixel settings, i.e. 1120 x 252, after that I was able to crop the picture to use it as header art.

    So now that the header is more or less what I want to see, there is no more use removing headers from all pages. So thank you again for your effort.

    Though I have one question, by adding pages I had hoped to see additional page "links" in the banner where the About VE3ERC is right now. Looking further I read that it supports only one .... (forget the word). Would it still be possible though?

    JB

  • Elliott Bristow

    It is possible (anything is possible), but how easy it is would depend on the theme.

    If the pages do not automatically appear, the theme may be set up to display only one particular page. If this is the case, and theme supports Custom Menus, you should have a "Menus" option in the "Appearance" section of your admin pages. This will allow you to create a custom menu, with the pages you want on it, which you would then be able to assign to the main menu (via the option in the top left corner of that screen.

    If you need more detailed instructions let me know... alternatively if you provide login details via https://premium.wpmudev.org/contact we can take a closer look for you and advise how to achieve what you want with your theme.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.