[resolved] Multiple Headers: PARSE ERROR (4 posts)

  1. jonhebert
    Posted 7 years ago #

    Hi all, I'm trying to put multiple headers on my WP site, but I'm getting a parse error. Homepage is set to "static page." I want one header for Homepage, and another for all other pages and blog. (None of the code below is implemented on the site right now, as I need the site accessible. In other words you will not see the parse error.)

    Site is at: http://bleuorleansmusic.com/

    Code I'm using that is giving error:

    if (is_page('home')){
    	<?php include(TEMPLATEPATH.'/headerhome.php'); ?>
    else {
    	<?php include(TEMPLATEPATH.'/headerdefault.php'); ?>

    I tried substituting "is_page" with "is_home" and "is_front_page" but they all give me the error.

    I know it's something simple, what am I missing? I'm not a PHP person, but I know just enough to be dangerous.


  2. Pinoy.ca
    Posted 7 years ago #

    is_page() does not have any parameters.

    For more info see http://codex.wordpress.org/Conditional_Tags .

    I hope this helps.

  3. jonhebert
    Posted 7 years ago #

    Figured a workaround. I called a unique header in the homepage template, which I set up, replacing:

    <?php get_header(); ?>

    with <?php include(TEMPLATEPATH.’/headerhome.php’); ?>

  4. iridiax
    Posted 7 years ago #

    It was a php error. Your original code had nested php tags (one php tag inside another), which is why it wasn't working.

Topic Closed

This topic has been closed to new replies.

About this Topic