• <?php
        $post = $wp_query->post;
        if ( post_type_exists( 'swc_staff' ) ) {
        include(TEMPLATEPATH . '/post-staff.php');
    
        } else {
        include(TEMPLATEPATH . '/post-news.php');
        }
        ?>

    I am trying to split off my single.php so I have a different template for custom post type posts to news posts. Is this arguement correct? it doesnt work for me. Instead it shows post-staff.php for both custom posts read more AND regular posts read more permalinks.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Single.php conditional arguement’ is closed to new replies.