Forums

Two 'single' page templates? (2 posts)

  1. Nightshade01
    Member
    Posted 3 years ago #

    I have customised single.php to show a menu of blog posts besides it. And I have created a second page template which shows a different menu beside it. However when you click on one of these posts in this menu, it shows it back in first layout (single.php). Is there a way to have two 'single' page templates?

  2. stvwlf
    Member
    Posted 3 years ago #

    something like this in your single.php file - take the heart of the contents of the existing file out of the file and create subfiles that are called in, in different conditions.

    <?php
    if (in_category('2')) {
      include (TEMPLATEPATH . '/single_dog.php');
    } elseif  (in_category('3')) {
      include (TEMPLATEPATH . '/single_cat.php');
    } else {
      include (TEMPLATEPATH . '/single_normal.php');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.