you’re using 'category__and' => array($category_name) which according to the input becomes 'category__and' => array('594,3')
Here ‘594,3’ is not a valid id
instead try 'category__and' => explode(',', $category_name)
This will make the input as 'category__and' => array('594', '3')
Related Posts:
- How to query only for products with status “in stock” in WooCommerce? [closed]
- WP_Query to show post from a category OR custom field
- get_posts with multiple categories
- ajax category filter
- Display recent posts from the same category as current post in sidebar
- How to filter by category in REST API, excluding posts also in other category term?
- Counting number of posts with Category B in Category A
- How to order category.php loop by ‘meta_value’?
- Use Transient API to cache queries for all posts in all categories?
- How can I display recent posts from a particular category in my header?
- Sorting Posts by custom field
- How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?
- WP Query with multiple categories – passing an array works?
- wp_query display posts from same category of the post
- WP_query category__in not working, only pulls from first category
- How can i make WP_Query return post image and categories?
- WP_Query order by date in meta_value
- How get posts from a subcategory of a category by name?
- get complex results set according to category structure
- Searching through different categories on different pages code is not working
- Get image of latest post from taxonomies/categories
- How to select posts from one category but exclude posts in another category?
- Retrieving list of a custom post type in a widget without using WP_Query?
- Get Category Archive Template Name Dynamically
- WP_Query arguments to fetch custom post type posts which are in certain category?
- How do I reset this wp_list_categories query?
- How can you get first post, last post and post count in a category?
- How to get count of posts assigned to given category?
- How to show subcategories using loop?
- Remove a specific category ID from related post
- Complex Category selection as per user input
- Five posts from a category in footer
- How to detect if query is runned from widget?
- How to get all unique categories for posts in loop?
- Most commented last 24h, week, month, year and all time – posts_where
- Display Featured Post by Categories and Avoid duplicated posts
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- Category applied to pages, creates multiple breadcrumb entries after a search query (On the translated site)
- category query for pages not working
- Query posts from category A, and from either category B or C
- Search Query for multiple categories using ‘OR’ but having certain categories be ‘AND’
- Combining categories (Query posts with multiple taxonomy terms)
- Check if loop has any categories?
- Filtering out child category posts from parent category archive not working
- Inserting HTML to close and open divs in WP_Query loops
- Finding WordPress Posts assigned to multiple categories
- Combine results of multiple WP_Query to resemble single WP_Query
- Error with function in functions.php?
- WordPress Custom Search Form Displaying Unexpected Results
- wp_query is showing posts from other categories
- WP_Query Taxonomy categories filtering
- How to load a script code only in posts?
- How to display a list of posts in same child category as current post
- How to exclude a category name from showing?
- Loop categories by recent post
- Get the child category ID of current category
- How to get posts by category and by choosing a taxonomy term?
- Related Posts Excluding Certain Categories
- Getting the permalink to the latest post from a category
- What is wrong with my WP_Query Arguments?
- All Posts Have The Same Comments
- Widget only in first post
- How to add a recent post function to a text widget I created for practice?
- get_the_terms has strange result since version 6.0
- Related posts by current posts child category
- Filter sub-category from checkbox form
- `offset` WP_Query argument dont work via `pre_get_posts`
- Function the_posts_pagination() not compatible with WP_Query arguments
- Filter products on category AND tag
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- How to use the Term Object from a custom select field in a query
- 3 posts from each existing category on one page
- Related categories order posts by category
- How to show specify category template for both parent and child category
- Display All Top Child Categories / Taxonomy
- Query post by Category and custom file (ACF)
- Display 3 levels of categories on page
- Filtering ‘Featured’ posts from a batch of category IDs
- Show posts from categories instead of tags
- How can I show only last year posts in wordpress archive?
- Multiple values in WP_Query : category__and
- Help displaying related categories
- how to avoid reloading/refresh the page when displaying the post of wp_list_categories
- Show full category tree for a year with all post titles?
- Retrieving category pages from subcategory returns empty sets
- query.php – multiple is_category functions
- Create multiple sections for all categories and then queries all the posts for each of those categories
- wp_query in form method of widget breaks customizer
- query_posts problem – need help
- Related posts with WP_Query
- Filter posts by category
- query_vars category_name only display one catgory out of multiple categories
- List categories using WP_Query
- I need to get all categories from a WP_Query
- Advanced Search – Is this possible?
- How to get post taxonomy url and name in wp_query
- Wp_query to get woocomerce product categorys [closed]
- Excluding a category from frontpage but not from WP_Query
- why same category base and single post base don’t work?
- How do I show related posts from categories instead of tags?