• https://www.hustleorfail.com is the website.

    I want my uncategorised posts to appear on the front page, and uncategorised only.
    I want my blog category posts to appear on the blog link (which is easy enough, I’ve just put a link to the blog category in my menu)
    unfortunately my blog posts are also appearing on the main page with the uncategorised posts. Any ideas?

    Cheers!
    -sc00t

Viewing 2 replies - 1 through 2 (of 2 total)
  • Add this code your theme’s functions.php file (thought it would be better if you added it to a Child Theme’s or your own simple plugin):

    function my_home_page_posts( $query ) {
        if ( ! is_admin() && $query->is_home() && $query->is_main_query() ) {
            $query->set( 'category_name', 'uncategorized' );
        }
    
        return $query;
    }
    add_action( 'pre_get_posts', 'my_home_page_posts' );

    Thread Starter sc00t

    (@sc00t)

    10/10 – thanks Jacob!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Seperating categories’ is closed to new replies.