Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12702

    I need to create a different header.php file for the inside pages loosely based on the original header.php file. How difficult is this? I have found many online resources with instructions but I figured it best to ask my theme author before going too far. Any insight would be a huge help.

    #76404

    Hi reggiescott,

    In order to use a separate header for the inside pages, you would have to edit each template file e.g. template_blog.php, template_contact.php, template_fullwidth.php, template_portfolio.php, etc. so that it would point to that header.

    The code you would need to alter is:

    get_header();

    You would need to have something like this:

    get_header('my-new-header');

    When creating the header file you’ll want to keep everything before the DIV “wrapper” for sure otherwise your pages may become skewed.

    Hope this helps!

    Regards,

    Mya

    #76405

    I tried this and is does not seem to be working. My new get_header code reads:

    get_header( ‘header-inside.php’ ); – which is definitely on the server.

    The new header is calling a new class for the wrapper – .wrapper2 – in style1.css that ONLY changes the background image for the header from bg.png to bg2.png.

    What could I be doing wrong?

    #76406

    Any more info on this? I tried the solution provided but it did not work.

    #76407

    Hi reggiescott,

    If you are only looking to change the background image on the page, you can use css with a lot less hassle. For the display theme, you would add new css for each page that you wanted to have a custom background. Following this example:

    #subpage.page-id-## .wrapper {
    background:
    #fff url(../images/skin1/bg.png) repeat-x 0 -370px;
    }

    If its a portfolio page or blog page, the css changes a bit since the class name for those pages is different:

    #subpage.postid-## .wrapper {
    background:
    #fff url(../images/skin1/bg.png) repeat-x 0 -370px;
    }

    In both of the above the ## needs to be replaced by either the Page ID or the Post ID number. This can be found in the URL of the page (just one way to find it) when you edit the post or page. If you are using Firebug or Inspect Element in chrome, you can find it in the body class line for the page you are inspecting.

    Regards,

    Devin

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Create multiple header files’ is closed to new replies.