ThemeShaper Forums » Thematic

[closed]

PHP include: Homepage only

(3 posts)
  • Started 3 years ago by erow80
  • Latest reply from erow80
  • This topic is not resolved
  1. erow80
    Member

    Hello all. I'm new here, as well as a PHP noob. I'm trying to serve a .php snippet into the homepage of a site I'm developing. I've got that working, but I can't figure out how to load it ONLY on the homepage. My code is below, as well as a link to the work in progress:

    function childtheme_include() { ?>
     <?php include (STYLESHEETPATH . "/slider.php"); ?>
     <?php }
     add_action('thematic_belowheader','childtheme_include');
    ?>

    Test site linkage:
    http://evolutionlandmanagement.com/wp/

    Big thanks for any help!!!

    Posted 3 years ago #
  2. azoomer
    Member

    Try this one:

    function childtheme_include() {
    if(is_home()){?>
     <?php include (STYLESHEETPATH . "/slider.php"); ?>
     <?php }}
     add_action('thematic_belowheader','childtheme_include');
    
    ?>

    if it is a static homepage use is_front_page instead of is_home

    oh and your menu goes behind the slideshow

    ul.slideshow {z-index:0;}

    will probably fix it.

    Posted 3 years ago #
  3. erow80
    Member

    Thanks Azoomer! Your solution worked like a charm. As did the z-index fix. I did try to use is_front_page instead of is_home but it threw and error. It's working now with is_home, but I can look into changing it if needed.

    I appreciate your help.

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.