Single.php conditional arguement (3 posts)

  1. stinkyleaf
    Posted 4 years ago #

        $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.

  2. It would be easier to simply make a single-{post_type}.php


  3. stinkyleaf
    Posted 4 years ago #

    Ok so I tried the get template part childtheme method

    I created a file called category-parnters.php
    in that file i created get template part loop , partners

    Then i created loop-partners.php

    Right now they duplicate loop.php and category.php

    I get the title to show up but the loop-partners.php is not loading. Am I leaving out a step?

Topic Closed

This topic has been closed to new replies.

About this Topic