• I have been trying to find the solution and/or plugin. from the forum and etc., yet still dont see any..

    Due to different design of the entrance (homepage and some extra pages) from all other blog pages, I need to add some differnt header files (header.php) under the theme folder.

    Could anyone help to advise how to solve this problem?
    thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jkin

    (@jkin)

    Anyone who likes to help, please also check
    Making Static Pages Look Like a Regular HTML Page
    I have posted it in that topic too..
    thanks

    Create another header template and simply call it from index.php whenever the condition is met(i.e. It is a home page)

    Thread Starter jkin

    (@jkin)

    Thank you Garry,

    I have been trying in using lots of methods, including your suggestion.
    Followings are what I have done:
    1). simply call a newheader.php, using <?php include (TEMPLATEPATH . ‘/topheader.php’); ?>,
    what I got is all pages come with this additionally called file.

    2). I named a newheader and I called it from some other pages that I dont need blog infos in them.. this works.
    yet, the homepage is still not working..

    3). I tried to add a home.php as my entrance page, using .haccess to direct it as the 1st entrance, –> failed again.

    4). finally, I returned to change the index.php to have it choose which header files to call. Again. I am facing a problem.

    The current problem is that I only need around 5 pages to use seprated headers, for the rest of blog info will still use the original header.php.

    In the 4th method, I tried to use the index.php as my homepage, all blog clickes go to this NOT-origianlly needed INDEX.php (NOT header.php), even I didnt change the header.php.

    Now I am thinking.. maybe I need to move my blog down to a 2nd level folders and keep them down as a subordinate blog site. ><
    However, in doing so, I also can see some problems, which I am not clear of.

    My concern about the last method is… all benifits that I can get from the wordpress plug-ins will have no connection with all other pages that I want to add, inclulding the HOMEPAGE. (what I am talking here is things like SEO and sitemap and lots of others.. )

    I do hope someone can help me out.. >_<..

    For those five pages, you can try this way:

    1 – Make a copy of page.php and rename it alternate-header.php (or whatever name you like).

    2 – Make a template of alternate-header.php, by adding at the very top

    <?php /*
    	Template Name: Alternate Header
    */ ?>

    3 – In that alternate-header.php template, include the TEMPLATEPATH to the new header

    4 – For each of the pages that you need the different header, from the attributes (when you first create them, or go to edit them), select “Alternate Header” as the template.

    This way, all other pages will use the regular default template, while the 5 pages will use another custom made template.

    Thread Starter jkin

    (@jkin)

    wow.. Buddha..

    thanks.. I have been to your blog.. and hoped you could help.. but. I was too shy to ask.. ^^

    thanks..

    I will try later.. and will inform you the result A.S.A.P.

    thanks again.

    @ jkin

    ask anytime, no problem!

    The good part about posting in the forum, is that the solution can potentially help other people with the same issue.

    Let us know if the templates worked for you!

    Wow! This was exactly what I needed. And it was easy enough for a PHP/Wordpress newbie like me to follow. Thanks!

    As an addendum, I used this to pretty easily set up a header for all my pages and a different header for all my blog posts / pages.

    Here’s what I did (borrowing heavily from the above).

    1 – I needed static pages w/ and w/o sidebars so I made a copy of page.php and renamed it pageHome.php. So I had 2 “static” page templates; one with a sidebar, one without.

    2 – I needed one header for pages and one for blog stuff so I made a copy of header.php and named it headerBlog.php. I edited my CSS to apply change to background image.

    3 – In archive.php, archives.php, index.php and single.php files I added <?php include (TEMPLATEPATH . ‘/headerBlog.php’); ?>

    And that was it! (Of course this belies the hours it took me to get to this point!)

    Thanks again for leaving the trail for the rest of us.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Different header.php for the entrance of a web site.’ is closed to new replies.