foreach ($categories as $individual_category) {
if( $individual_category->term_id == 81 || $individual_category->term_id == 82 )
continue;
$category_ids[] = $individual_category->term_id;
}
explanation:
the above replaces:
foreach($categories as $individual_category)
$category_ids[] = $individual_category->term_id;
i.e. the code jumps over the to be excluded categories.
Related Posts:
- exclude category from get_posts?
- Exclude the category from the WordPress loop
- Exclude certain category from latest updates
- Exclude categories from Loop, queries, widgets, post navigation
- List posts by category exclude current post
- wp_list_categories exclude not working
- Excluding a category from next and previous post links
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- How to exclude categories from recent posts, recent comments & category widgets?
- Exclude a category from the filed under list only on some templates
- How to exclude posts from a category when using this particular format
- Exclude category from Tag Template
- exclude post from displaying in loop if it is in a category, but not in many categories
- I need to create a search form that will display search results from specific category
- Exclude Posts From Specific Category from Next and Previous post links
- Query Posts Exclude Entire Category
- exclude categories from search results
- WordPress category widget only show categories with children
- wp_list_pages() exclude category
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- Woocommerce filter function not updating
- wp_list_categories not excluing multiple ids
- How to exclude posts from category posts count
- Exclude category from foreach loop
- Have posts that belong to multiple categories, exclude some categories from homepage
- Exclude all subcategories in the_category (post)
- I need to exclude from a query a category and a few custom taxonomies
- Exclude categories by ID
- Homepage custom recent news
- Exclude the category in WordPress
- How can I exclude a category from the main loop with the category name & not ID?
- User level categories
- Exclude category from drop down list form
- exclude certain categories form archive widget
- How to remove an item from a custom Walker_Nav_Menu
- Exclude a category and post_type from wp_query
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- Exclude category from WP_Query args not working
- Displaying Category in sidebar post widget but not in the loop on home
- Category menu that filters out empty categories
- Problems with explode [closed]
- Exclude Category From Home Page, Display Posts on It’s Own Page?
- How to have a category not show up in query post with page panigation?
- Customize category query in widget
- Call function on a single page
- Excluding cateory not working on my site. how to solve this? [closed]
- How to define category ID in an array?
- Get the children of the parent category
- How to remove the term “category” from category pagination?
- How do I get the category URL from get_the_category?
- Deleting All tags except categories Wp database
- How do I change the sql query for wp_get_archive()
- How to put enctype=”multipart/form-data” in categories form?
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Custom WP_Query for current category (in category.php)?
- Why is get_the_category() saying that I have two categories?
- Insert Into Sub-child Menu
- How do I get the category slug from wp_dropdown_categories
- Change the category of all posts in it
- Search Posts / Pages with multiple options?
- How to hide some categories in category list under post in wordpress?
- List categories with posts
- The default code for “posts_nav_link” on category.php isn’t working
- Custom sub taxonomy order by
- Hide uncategorized when no category set
- Refine/Filter the Search Results by Category
- Have multiple category queries from the URL been fixed yet?
- Why is it so hard to show the URL of the current category and how to do it?
- Where and when does WordPress invoke routes
- Getting category URL with hyphens, not spaces
- How can I change the tooltip in the_category?
- How to get Next/previous_post_link to go through articles in top parent category
- Conditional loop for category
- Fix Warnings that shouldn’t be necessary to fix
- how to get correct category of a post in case of multiple categories?
- Show button only for certain Woocommerce Product Categories
- Pagination for query_posts();
- echo get_post_meta of all post in a category to fill up a select field
- get listed category’s id?
- Notice: Undefined variable: category_id
- Is it possible to create an alias/custom taxonomy for a category name?
- Multiple category columns and post counting list in wordpress Homepage
- wp_insert_link not working
- add current-cat class to single post page
- Problem with pagination block in Gutenberg
- Product category display in tabs
- How to redirect to category page if page does not exists?
- Sort categories by custom field in WordPress admin
- Related to genre and category
- Get permalink to latest post in category
- How to load terms of a custom taxonomy of a product in woocommerce cart page
- Removin /page/2 from pagination
- get parent_category class in loop
- Group Posts by First Letter of Title categories
- Alphabetize all but one category
- Printing direct descendants of a category with WP_Query
- Page view: Sorted by categories
- Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin?
- Showing one post from each category, paged?