Forums

permalink issue causing sub-categories not to be displayed (4 posts)

  1. sprichie
    Member
    Posted 4 months ago #

    I was using /%postname%/, made about 10 posts and everything was fine. Changed it today to /%category%/%postname%/ then all my posts were accessible, but when I clicked on the cateorgy name I received a "page not found" error message. I switched the permalink to the default to just use the Post ID and posts and categories were accessible. I then switched it back to /%postname%/ and categories not accessible again. So as it stands the permalink structure is /%category%/%postname%/ and all posts and categories work except now when I click on a sub-category I get the "page not found" error. If possible I would just like to be able to use /%postname%/ again.

    My .htaccess file looks like this which I think is ok. Not sure but from what I've read could this be causing the issue?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    My site is Sprichie.com

  2. sprichie
    Member
    Posted 4 months ago #

    Update: I used the permalink redirect plugin so at least now the links I have out on the web will still yeild a page when people are clicking through.

    My sub-category "children toys" under "product reviews" still shows a "page not found" error. All main categories show and show the contents within them.

    Thanks,

    Scott

  3. jazbek
    Member
    Posted 1 month ago #

    I am having the same issue. Anytime I click on a sub-category, I get page not found. Visiting a first-level category archive works fine. Did you ever get this resolved?

  4. jazbek
    Member
    Posted 1 month ago #

    I figured out my issue in case anyone comes across this -- I was using categories on a custom post type. When I went to view one of the categories that only contained my custom post type, I'd get page not found. The real issue was that the default query only searches for posts (not custom post types). I wasn't really getting page not found (it wasn't showing the 404.php template), but it was displaying something like "Sorry nothing was found." because it didn't find any posts.

    I had to modify the query on my category.php page to include custom posts:

    <?php
    global $query_string;
    query_posts( $query_string . '&post_type=any' );
    ?>

    And then everything started working.

Reply

You must log in to post.

About this Topic