• I have a single.php file that’s used to establish custom post templates for different categories on my site. Everything worked fine from 2.2 to 2.9.2, but it stopped working with my upgrade today to 3.0.1.

    All posts, regardless of category, now default to a generic single-post.php template file.

    Any ideas why this suddenly isn’t working? I’ve tried searching forums and google, but haven’t found any mentions of this. Here’s what my single.php file looks like (I cut a bunch of elseif blocks out):

    <?php
    $post = $wp_query->post;

    if ( in_category(‘5’) ) {
    include(TEMPLATEPATH . ‘/single-5.php’);

    } elseif ( in_category(‘8’) ) {
    include(TEMPLATEPATH . ‘/single-8.php’);

    } elseif ( in_category(’16’) ) {
    include(TEMPLATEPATH . ‘/single-16.php’);

    } else {
    include(TEMPLATEPATH . ‘/single-post.php’);
    }
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter bschnure

    (@bschnure)

    There must be some new reference to ‘single-post.php’ in WordPress that didn’t exist previously.

    I changed the name of my default post template from ‘single-post.php’ to ‘default-post-template.php’ and all of my category post templates now display properly.

    Weird.

    Hello,

    I Have the same problem, however when I change it to post-template.php’ or post.php it shows all the posts!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘single.php not working after upgrade from 2.9.2 to 3.0.1’ is closed to new replies.