Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter trihedron

    (@trihedron)

    Review the instructions about creating your own Page templates.

    Yes, you can have a different header – e.g. you can replace the WP-specific call get_header with an include line:
    <?php include(TEMPLATEPATH . “myheader.php”); ?>
    Change only your file name, don’t touch the rest!

    Moshu,

    Thanks a bunch for your assistance. I have resolved my problem with your help.

    Here is my quick run through, just in case someone else may ever need an extra push in the right direction.

    I have a locations page that I wanted to add Google Maps, but since Google Maps requires you to call the onload="load()" onunload="GUnload()" code from the body tag, if you are using just one header.php on your site, the rest of the pages will throw javascript errors for not having the rest of the google code to display the map.

    I copied my header.php and renamed it to location_header.php, from there I removed the google map body tags from the normal header.php.

    I then created a custom page file locations_page.php based off of my old page.php, but this time changed the normal header call to:

    <?php
    /*
    Template Name: Locations Custom Page
    */
    ?>
    <?php include(TEMPLATEPATH . "\locations_header.php"); ?>

    –The first part just tells word press this is a custom page template, and the second part is the actual call to the new locations header inside my template path.

    Then from the post management screen (or the writing screen), a new section becomes available called “Page Template”. I specified my new “Locations Custom Page” as the alternative template and I was set!

    Thanks again to moshu for the push in the right direction.

    Problem Solved.

    Thread Starter trihedron

    (@trihedron)

    ^ oh sorry.

    I’ve been developing with ASP pages for the longest time and now that I’m back with PHP my brain just automatically types things.

    I will give this a shot. I’m still a bit confused about it a little bit now. But I just need to re-read your message a bit more.

    Thanks again for the quick response.

    Thread Starter trihedron

    (@trihedron)

    Thank you that helps a lot.

    About the headers….How can I specify that if the page is “locations” use <head runthis()> rather than the normal <head>.

    My <head> is currently in header.asp. I just dont want a javascript error on all the pages that do not have a location map (only one page has the map on it.)

    Thanks for the great lead though, i finally understand how to do custom pages.

Viewing 3 replies - 1 through 3 (of 3 total)