• So I need to exclude two categorys from the sub-blog [ redundant link removed ]
    so that they only shows up on their respective categorys page.
    I have done this before with excluding from main blog but how do I go about doing it from the sub-blog?
    It has its own taxonomy so a bit tricky.
    I have the following code for excluding from the main blog and I guess it is just a question of getting the query and if-statement right:

    function exclude_category( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
    $query->set( 'cat', '-1942, -1943' );
    }
    }
    add_action( 'pre_get_posts', 'exclude_category' );

    any help with the direct issue or/and how i find out the correct query is much appreciated

    • This topic was modified 4 years, 7 months ago by Steven Stern (sterndata).
    • This topic was modified 4 years, 7 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @anderslinn, is “sex-som-funkar” a category itself or a page?

    Thread Starter anderslinn

    (@anderslinn)

    it is a blog itself , separated from the main blog. in it it has the category “recensioner” beside the blog itself now. it gets separated fine based on category , but not of my doing.

    Thread Starter anderslinn

    (@anderslinn)

    nwm, owner changed her mind,they don’t need to be hidden now. but if anyone have a solution anyways for future needs that wouldn’t be bad either.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘exclude categorys from sub-blog NSFW’ is closed to new replies.