Forums

single.php not working after upgrade from 2.9.2 to 3.0.1 (3 posts)

  1. bschnure
    Member
    Posted 1 year ago #

    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');
    }
    ?>

  2. bschnure
    Member
    Posted 1 year ago #

    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.

  3. shivark
    Member
    Posted 1 year ago #

    Hello,

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

Topic Closed

This topic has been closed to new replies.

About this Topic