Instead of trying to use “excluded categories”, I think you should use “included categories”.
One solution would be :
- create an array of the catagories you want to exclude
- create an array of all the categories
- use “array_diff” to build an array of the categories to be included
Or maybe you can work with the wordpress function “get_terms” to create the list of the categories to be included.
Hope this help
Related Posts:
- exclude category from get_posts?
- Filter by post category in Media Library
- categories on attachment page
- Get id of category from drop down menu
- Show post only if match all categories
- Code to pull in a PHP file named after the category ID
- Taxonomies for WordPress Media Library [duplicate]
- in_category() works in single.php but not in page.php?
- Add title, post content, and category like add_post_meta and update_post_meta
- Show only one category
- Show recent posts from one category on a non-WP site
- Implementing a tricky wordpress menu (nested categories + thumbnails)
- Taxonomy filter all children
- Add Image Size for one Media Category Only
- Retrieve Image from Media Library by it’s category
- Second level subcategory
- get_posts and multiple categories
- query in category.php repeats itself
- Trying to only display 1 category using get_posts
- Get link which associated with a specific category and tag
- Counter in loop in foreach
- Get posts from 2 different categories
- categories on attachment page
- Woo Framework: woo_cat_featured not populating
- Get posts from specific taxonomy term
- Redirect to another page using contact form 7? [closed]
- Create menu locations for each category in wordpress
- List all posts in a category with query_post() function
- Different Output for “Every Other” Foreach Statement?
- Hooking to walker_nav_menu_start_el to insert list of subpages
- get_posts ignoring ‘category’ and displaying all posts
- How to pull a list of posts in a category while exluding posts in subcategories of the category
- How to Link to Most Recent Custom Post of Same Term
- get_posts() from parent category only using a shortcode
- How to link a PDF file to a category URL
- Exclude category from foreach loop
- Exclude parent category when getting category posts by slug
- Exclude categories from homepage not longer working
- Showing posts from 2 categories only on category.php
- get all categories’ latest post in one query
- Explode() expects a string
- Load the last post of a category
- get_the_category return empty inside loop
- Image Upload Custom Form Field for Category and Custom Taxonomy
- Get posts base on category ratio of more then two categories
- Media Library Categories
- Multiple if statements with else for get_the_category [closed]
- Cant get unique_array() work on get_the_category() foreach loop
- How to add Pagination to foreach loop to page
- Media Categories as Classes on WordPress Gallery Shortcode
- How can I modify this code to iterate over an array of categories?
- foreach,having wp_query inside, breaks after showing one result
- Category foreach Paging
- Media Library filter returns undefined function get_current_screen
- show/hide attachments
- Display only the latest post
- Paginating a list of all posts collected by category titles
- not empty categories don’t show in menu [closed]
- how to call the category of the post
- how to edit wp category widget
- Call Current Category
- Page permalink rewrite
- Featured image for links and categories
- How to create a custom loop ordered by Categories on a Page Template?
- How to change category id on get_posts array
- get posts from 2 categories. (2 posts)
- how to ask if in two categorys inside if
- Add Category names to post lists of custom post type
- Query posts from category based on a filter most favorited
- how to query posts and auto assign category if post title has keyword
- How do I call posts with a certain tag?
- How do I get rid of “category” from my URL structure?
- Displaying a full post instead of a slug per category?
- Subcategories with the same name
- Checkboxes in the category list?
- Warn me about ‘uncategorized’ posts
- Automatically exclude categories from metabox based on title
- one category template for multiple categories
- Link Attachment Image to Category
- Exclude a category from the_category in the single post page
- Modify WordPress SQL Query to pull from within a category
- query order by category
- Making the category & tag Description textarea bigger
- Display posts separated by Category in Author’s page
- What is an equivalent of single_cat_title for getting the slug of the category?
- How can i insert term in a specific language of Polylang?
- How to make 2 tag feeds show up on 1 page?
- Class active for Archive link – looped out
- WordPress search only showing a few posts
- Issue adding sub category programmatically
- One Specific Category To Permalink
- WordPress category page redirects in .htaccess not working
- Solution for ascending order in a category
- Why do my categories redirect?
- Hide woocommerce category name from specific pages
- Hide woocommerce category name from specific pages
- need to add custom field in more products
- Taxonomy name repeating when showing 2 posts from each category
- Category being displayed without base parmalink
- Why does the argument list_only do on Walker_Category_Checklist::start_el?