Ready to get started?Download WordPress


Different header on home page (4 posts)

  1. TSemmes
    Posted 2 years ago #

    My template has a slider on the homepage in the content area. I want it in the header area (above the navigation and below the logo).

    I took
    <?php include (TEMPLATEPATH . '/includes/homepage-slider.php' ); ?> from the homepage template and pasted it into the header template. Works fine but of course I don't want it on every page just the home page. This might work with the conditional tag
    <?php if (is_home()) {

    but I am not sure how to put it all together. Any idea?

  2. TSemmes
    Posted 2 years ago #

    I tried this:

    <?php if(is_home() ) {
    //do slider
    <?php include (TEMPLATEPATH . '/includes/homepage-slider.php' ); ?>
    } else {
    //do nothing
    } ?>

    But the slider is not appearing. Is there an error with the code?

  3. TSemmes
    Posted 2 years ago #

    Thanks! That works. Didn't occur to me to use that.

Topic Closed

This topic has been closed to new replies.

About this Topic