• Hi,

    I moved my blog from discojing.com and hapatite.com. I only want to show new posts from hapatite.com on the home page while keeping all the old content for archives, indexes, and search.

    When I exclude the category I applied to migrated posts, discojing.com, cat id 88, it makes the pages ~4 instead of 50+, which is good. But then when I click on any page other than 2, it’s “File not Found”.

    This is when I exclude it in functions.php with

    function exclude_category($query) {
    if ($query->is_home()) {
    $query->set('cat', '-88');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');

    Or when I use Simple Exclude plugin. Is there any way to do a if_category, is_home, don’t show argument? I’ve used if_category to add things, but not hide content.

    I heard this might be an issue with published posts and expected post numbers not matching up.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I think the last line filters out all categories because of which you get the 404 errors.

    Thread Starter hapatite

    (@discojing)

    The filtering works. There are 55 pages of posts and it truncates it down to 4 pages. But, when I click on the “Next” page links (aka /page/4 or /page/3), it says “404 not found”.

    ??

    Please post at the https://studiopress.com forums for this. ??

    discojing, I’m not sure I have any advice. I do know my plugin, Simply-Exclude should properly handle the pagination. The plugin does basically what you are doing with the ‘pre_get_posts’ filter in your functions file. It excludes the category from the query.

    Sounds like your move might be something of the culprit.

    Thread Starter hapatite

    (@discojing)

    I get this issue no matter what theme I use, not just the SP theme

    Thread Starter hapatite

    (@discojing)

    I saw mentioned somewhere that it’s an issue with

    published posts and expected post numbers not matching

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page Links become "404 File not Found" when Categories are Excluded from Home’ is closed to new replies.