New Landing How can we help? Themeforest Theme Support Dante select template by team-category

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Dante
  • #79954
    pdupree
    Member
    Post count: 40

    If a team member has team-category tag_ID=100, a different template would be used. The following code is in /dante-child/single-team.php.

    
    <?php
    $post = $wp_query->post;
    if ( in_category('100') ) {
    include(TEMPLATEPATH . '/single-team-ensemble.php');
    } else {
    include(TEMPLATEPATH . '/single-team-member.php');
    }
    ?>
    

    I’ve tried TEMPLATEPATH, SF_TEMPLATE_PATH, SF_LOCAL_PATH and none work.
    I’m using these instructions: http://cameraontheroad.com/2005/05/different-category-different-look-creating-multiple-single-post-looks-for-different-categories/

    #80042
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try this code:

    <?php
    $post = $wp_query->post;
    if ( in_category('100') ) {
    get_template_part('single-team-ensemble.php');
    } else {
    get_template_part('single-team-member.php');
    }
    ?>

    Hope that should help and let me know your feedback.

    Thanks 🙂
    With Best Regards
    Swift Ideas

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register