I’m pretty sure it’s because you’ve got mixed nested quotes when you’re setting $CatIDsCode
.
So this should fix it:
$camp_posts_bynumber = new WP_Query (array ('cat' => $CatIDs));
P.S. Move $CatIDs= implode(',', $out);
outside of the foreach
loop. 🙂
Related Posts:
- How do I query for posts by partial meta key?
- WP_Query orderby date not working
- Display products from specific category in shop page
- meta_query where value is equal to given value
- Query by meta_key and order by meta_value_num return orderby date
- WP Query post meta value
- Understanding the use of wp_reset_query();
- How to exclude products by tag from woocommerce shop page?
- Filtering posts by custom field value not working
- wpdb get results doesn’t work with variable
- WordPress posts per page WP_Query
- WordPress WP_Query orderby being overwritten
- Multiple meta queries but arrange by specific meta value order
- Custom pagination with WP_Query generating 404 error
- Query post with meta_query where date is not in future
- Apply CSS class to every second database record [closed]
- pre_get_posts order by not working
- merge two query arguments into one WP_Query call
- How to display specific posts with WP_Query?
- How do I change the order (ASC and DESC) in the following retrieval method using WP_Query?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to get all child pages in their parent page?
- How to display summary content from a Page (Not a Post) on another page
- Custom Search Not Consistent with Results
- how do we display all posts from a particular category in homepage?
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- meta_query in WP_Query value is not accepting array
- Add capabilities via plugin for another plugin
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- How to query custom post types with mixed AND & OR statements for custom fields
- Custom post type archive pagination query issue
- WP Group posts by year(desc) > month(desc) > date(asc)
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- Check the Specific Meta Key IF its Meta Value is Empty then… (WP Post Meta Query)
- wp_query search not taking keywords with together for multiple words
- Adding a html class based on post count
- meta_query fails to compare on values containing apostrophes
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- Filtering posts by archive showing all years
- Apply filters to main query instead of creating new one?
- WP_Query returns different results from get_posts() [closed]
- WP_Query posts_per_page strange caching
- wp_query show all values
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- mysql query order by
- Why do I have to use pre_get_posts with custom WP_Query to reset posts_per_page?
- WordPress dynamic AJAX query
- Custom Taxonomy Breaks Pages
- Using rewind_posts for displaying multiple categories
- Query to get last posts from authors of blog
- WP_QUERY tax_query not working
- How to get latest post excerpt from a specific category?
- Get all content on a “single page” site depending on language
- Get list of all Grandchild Pages
- get latest added term from taxonomy and insert into php variable
- WP_Query not returning correct result with meta_query parameter
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Custom query to retrieve oldest post and retrieve others with date interval
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- How to display Woocommerce products list by tag
- Display the search results like the original pages
- Pagination on archive.php not working?
- Unable to reset post data in wordpress custom query
- Check the product in the cart from which category is and show message
- How to filter on placeholder image
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- WP query for two post types how to order newest to oldest with two different meta fields?
- Get posts with any value in attribute
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Order & Orderby clause not working with custom query
- how to get dynamic data on wordpress from codeigniter?
- How to create page that lists tags by initial letter?
- Seach and categories not working when ignoring sticky posts in main loop
- How can I create another instance of my custom shortcode
- How To Call WP_Query From A Subdomain?
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- WordPress: Cron locking and Queue
- Correct Way To Run Multiple Queries Sharing Some Base Data
- how to query for meta_value have array
- How to make the default WordPress search return borader results
- WP_Query shows all posts on single post pages
- Display Count of posts
- Show sticky post before other WP_Query
- List ALL posts within last week from current category on category page
- WP_Query on “property” in the options table
- Post OrderBy slow performance
- Dynamically name array in WordPress loop – add/get values
- Creating Custom Query
- WP_Query issues with argument posts_per_page
- Search (Custom Form, Custom Search Result)
- Hook to get the query result after listing posts
- Elementor custom query
- List categories using WP_Query
- WP Query – Show custom posts only if user contain some user meta
- How do I subquery with custom meta fields?
- Advanced Search – Is this possible?