Support » Fixing WordPress » is_page_template conditional not working for me

  • Hi,

    I am trying to print out h1s using WP as a CMS. I have a blog page too and want that to show up with the h1 “news”. Using conditional tags has worked great up until I tried to add one more using is_page_template (because I’m using a flickr plugin and can’t identify the page any other way) and that doesn’t seem to work.

    I have the page http://www.ipswichma375.org/events/photo-gallery/album/72157618789678415/photo/3571022992/doyon-school-project-photos-dscn1229.html printing out the template used at the bottom and that matches up but the h1 doesn’t print out as “photo gallery” as I want it too.

    Any suggestions – code for h1s from my header.php below and the site is http://www.ipswichma375.org.

    THANKS!

    <h1><?php if (is_page_template('photoalbum-photo.php')) {
      echo "Photo Gallery";
    } elseif (is_front_page()) {
      echo "Ipswich 375: Home";
    } elseif (is_page()) {
      wp_title('');
    } else {
      echo "News";
    }
    ?></h1>
  • The topic ‘is_page_template conditional not working for me’ is closed to new replies.