• Resolved escottster

    (@escottster)


    The permalink structure I want to use seems to be breaking my single posts.

    When I use the default ?p=number permalinks, a single page will display fine. But when I change my settings to /%category%/%postname%/ the is_single function returns false on single posts, and if I run it through the loop it gives me the ‘no posts’ message.

    Right now my main index.php has this:

    if(is_home()){include(‘homepage.php’);}
    else {include(‘categorypage.php’);}

    And the categorypage.php starts:

    if (have_posts()) : while (have_posts()) : the_post();?>

    What am I doing wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • /%category%/%postname%/ not a real good structure to use…

    From Using Permalinks

    For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields.

    Thread Starter escottster

    (@escottster)

    Well, I tried one that it recommends in that article: /%year%/%postname%/ but that doesn’t solve my problem.

    I noticed that when I use the default permalinks for single posts but leave %category% for my category permalink structure, both are broken (i.e. going to mysite.com/mycategory gives me the no posts error).

    Provide a link to the problem and maybe someone can see a solution.

    Thread Starter escottster

    (@escottster)

    Well, right now the site is at:

    http://edosco.com/7blr

    One of the categories is

    http://edosco.com/7blr/comics

    Thanks for looking!

    I’d switch to the default permalinks, (leave the category base blank), switch to the TwentyTen theme, deactivate all plugins, to see if that resolves the problem.

    Thread Starter escottster

    (@escottster)

    It is solved!

    Doing what you said did seem to work, even when I switched back to my custom theme. It turns out having %category% as my category perm. structure was what was screwing everything up.

    For now I’ve stuck with /%category%/%postname%/ since everything is working and I like how my permalinks look that way. If I start seeing performance issues I’ll switch back to the %year% method.

    Thanks for the help!

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

The topic ‘is_single() doesn't work with my permalink structure’ is closed to new replies.