I think your logic is too complicated. Setting up query_posts()
is essentially setting up MySQL query for database. No way query would be able to easily count amount of assigned categories on the fly and run conditions against that.
Let’s flip your condition. Instead of posts that aren’t in slideshow category alone we can do much simpler posts that belong to any category other than slideshow.
Try this:
$categories = get_categories( array( 'exclude' => '1,36' ) );
$include = array();
foreach ( $categories as $category )
$include[] = $category->term_id;
query_posts( array( 'category__in' => $include ) );
PS I’d consider some other way to mark posts for slideshow (like meta field) and not mix it with categories altogether.
Related Posts:
- How to display posts under a specific subcategory of a given category
- Overriding default calendar to show posts from a category
- is_category() in pre_get_posts strange error
- Rearranging posts based on categories
- Filter categories using tags
- Make parent categories not selectable
- Custom Query to search through categories
- How to query all posts of a specific category, and any other category combination
- is_category in pre_get_posts results in php notices
- Query the Loop without breaking it
- Add custom category name as data-filter to switch between these categories
- How to Check if a Child Category is Being Queried
- Can paginate_links() be customized for a specific category or tag?
- Filtering by Category doesnt paginate correctly on the backend
- Dropdown category filter
- How Do I Merge Categories With phpMyAdmin
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Make parent category not selectable when it has child categories
- Replace category titles
- If newest post of category is newest post in general, skip first post of category
- Hide posts of a certain category unless logged in
- Disallow categories from this MySQL query
- What’s the Simplest Way to Override/Rewrite the %category% Permalink Structure Tag?
- Include posts from feature category in pre_get_posts
- How to Filter categories in the permalink structure
- Taxonomy filter all children
- Filter Home Page Posts in Buddypress [closed]
- get_the_category and echo out link to child-most/deepest category
- Categorising posts/pages into years published
- Inserting Category programmatically
- Automatically set default password to all posts in a specific category
- get_the_categories filter returns an empty array
- category filter doesn’t work in WPML
- Query posts from category based on a filter most favorited
- query in category.php repeats itself
- Display posts separated by Category in Author’s page
- Filter Categories in meta box for CPTs
- Category param redirect to post type archive
- How to get related tags based on a category?
- Show only first category name in RSS?
- How to organize custom categories for filtering and selecting
- Filter $cpt categories to omit certain category
- How to set a filter by category within a customised page
- Show popular post by category code
- How to get latest posts from each category in regular order
- Refine/Filter the Search Results by Category
- Admin comments and user restrictions
- category pagination got broken suddenly
- WordPress Post # of # filtered by category slug
- Pagination for ajax category filter
- ajax for filtering posts by category in wordpress loops
- How to hide category name
- How to query categories with Advanced Custom Fields?
- Where and when does WordPress invoke routes
- And/Or Category Query
- How to make the ‘delete’ button inactive on some categories?
- Exclude category from query
- How can I display tags as categories?
- Display all product tags associated with a specific product category
- Filter WooCommerce archive pages by an additional category
- Portfolio Filter Buttons Wont Work
- “Virtual category page” based on a custom field filter
- Custom tax_query filter not working for Woocommerce product categories
- function query_posts disabling current_page_menu class
- How to hide some categories in dashboard
- Change post title if post has specific category
- Filter By Category Dropdown List With Custom Taxonomies
- How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category
- Using in ‘category_name’ in ‘$query->set();’?
- custom query for both category and pages using global $wpdb;
- How can I filter posts by tag on the fly
- Get categories of queried posts
- Query from multiple category (and)
- How to display posts from specific category using get_option function?
- SQL query to get posts from multiple categories but not in a category
- Change Default Content when Creating a Post based on Previous Category Choice
- Conditional category query breaking?
- Maintaining a separate posts page for certain categories and don’t show those on home page
- Get current taxonomy and display query accordingly
- Exclude posts without category from loop
- Category name for all posts getting assigned to a single random post
- Show Posts via cat+cat in URL that are in both Categories doesn’t work
- How to fix select filter on category
- wp_dropdown_categories() works correctly but the list is not filtered in admin for custom post type. What is the problem?
- List of post categories only associated to another custom taxonomy
- Add $args to wp_list_categories
- How to hide a category or tag everywhere EXCEPT for use with get_posts
- Add filter for specific category only
- How to create category filter on a blog like on the site below?
- How to filter tags by category?
- how tho change number of posts in loop from specific categories
- Custom Taxonomy Isotope Grid – Filter Buttons Not Working
- How to exclude a category returned by get_categories from function.php?
- Can’t display posts by filtering categories using isotope.js
- Correct Hook/Filter to amend category choices on post edit page
- Restrict retrieved terms by category?
- Get category from slug list
- Hiding by default posts in given category except for some cases
- Issue with WordPress category search
- Querying posts from two different categories while looping inside another loop