Forums

[resolved] Using in_category for multiple categories (1 post)

  1. dorsetforyou
    Member
    Posted 1 year ago #

    I understand how in_category works, for example here's a snippet from my single.php

    <?php
    $post = $wp_query->post;
    if ( in_category('18') ) {
    include(TEMPLATEPATH . "/single-cbc.php");

    } elseif ( in_category('19') ) {
    include(TEMPLATEPATH . "/single-dcc.php");

    And that works fine. But how do I make it so that if a user selects both category 18 AND 19 together, their post is given the /single-cbcdcc.php template?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic