Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mymommysplace

    (@mymommysplace)

    Figured it out! The problem was a category visibility plugin.

    Thread Starter mymommysplace

    (@mymommysplace)

    Once again, after hours and hours of head-banging, I figured it out.

    Here was the problem:

    <?php
    $post = $wp_query->post;
    if ( in_category('ohsays') ) {
    include(TEMPLATEPATH . '/single1.php');
    }
    if ( in_category('ohcares') ) {
    include(TEMPLATEPATH . '/single3.php');
    }
    if ( in_category('ohwow') ) {
    include(TEMPLATEPATH . '/single4.php');
    }
    else {
    include(TEMPLATEPATH . '/single2.php');
    }
    ?>

    should have been:

    <?php
    $post = $wp_query->post;
    if ( in_category('ohsays') ) {
    include(TEMPLATEPATH . '/single1.php');
    }
    elseif ( in_category('ohcares') ) {
    include(TEMPLATEPATH . '/single3.php');
    }
    elseif ( in_category('ohwow') ) {
    include(TEMPLATEPATH . '/single4.php');
    }
    else {
    include(TEMPLATEPATH . '/single2.php');
    }
    ?>

    Daggone “else.”

    Thread Starter mymommysplace

    (@mymommysplace)

    I was able to resolve the problem myself. Instead of using this

    <div class="comments-template">
    <?php
    $post = $wp_query->post;
    if (in_category( array( 3,9 ) ))  {
       include(TEMPLATEPATH . '/comments2.php');
    } else {
       include(TEMPLATEPATH . '/comments.php');
    }
    ?>
    
    </div>

    to call different comment templates, I made different single.php files that called the appropriate comment.php.

    Perhaps I used too many conditional tags? I don’t know, but it’s doing what I want now.

Viewing 3 replies - 1 through 3 (of 3 total)