• On my site, I have a booking blotter I made to connect with the local Sheriff’s office:

    https://ellatinodigital.com/categoria/detenidos/

    I filter them out from the home page with a filter function in functions.php.

    The problem I’m having is this:

    If you click on an individual to go to a single post view, it says that the post does not exist. This is not correct.

    The post is in the database and neither the slug nor the direct “?p=#” work.

    I believe that somehow, it is being blocked beyond just the homepage.

    My filter function is below:

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

    I’m a very good developer but I am new to the WordPress platform.

    I appreciate your time and consideration.

  • The topic ‘Homepage excluded category not showing in single post’ is closed to new replies.