Try referencing the cat query variable like so:
$custom_query = new WP_Query(
array(
'cat' => get_query_var('cat')
)
);
Related Posts:
- Exclude most recent posts from specific category in wp_query()
- Retrieve post tags from from main wp_query
- Unable to get all tags from specific categories
- Display related posts with same category or same tag return blank
- Get all categories and posts in those categories
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Control term order on a per-post basis
- Combine two taxonomies in a hierarchical tree
- Rewrite URL with category and tag combined using WP_Rewrite
- How to tax query X number of posts related by tag first, then by category if not enough in tag-related
- How can I reduce the number of database query calls for this custom homepage?
- Get page content by category or tag
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Create subdomains for tags and categories
- Automated adding of one tag to all the posts in a category
- What could be causing my wp_query pagination to break?
- Moving Categories submenu to Media, but still opens Posts menu
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- How to totally get rid of Category in my blog?
- How to Check if a Child Category is Being Queried
- Deleting All tags except categories Wp database
- Is it possible to put tags and category information in the post as text?
- Search by word, category, tag, author
- How to filter archives both by category and tag?
- display most popular tags of category?
- How to run WP_Query to retrieve attachments to posts only from a particular category?
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- WP_Query() returns null when results exist!
- Ignoring a category in WP_Query still shows the links in next_post_link()?
- How can I duplicate categories and tags?
- Random post + categories + tags
- Enter a variable in the ‘category_name’ parameter
- RSS/XML of all Categories and/or Tags
- How to query post like normal search would do. within search.php page
- Get Tags specific to Category using WooCommerce plugin
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- Query posts intersecting tags and categories
- Needing a snippet for listing category specific tags
- How to display categories which contains particular tag?
- “Categories” for six authors [closed]
- How to list categories within tags?
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Use Tag input metabox style for Categories
- change recent posts based on category
- How to remove specific categories from posts?
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- Have multiple category queries from the URL been fixed yet?
- Set colors depending on category
- Related Tags not in category
- scaleability of tags
- Custom loop of a single category, cannot order by date. What am I missing?
- Pagination on category.php and tag.php not working
- How do I add a tag slug to a category URL to filter posts?
- Show the amount of posts in a tag in a specific category has
- Display all product tags associated with a specific product category
- How replace individual elements in the RSS feed with a single string
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- Adding a block with query in homepage
- Conditional category & tag statement
- I need to exclude from a query a category and a few custom taxonomies
- Return category posts with WP_Query
- Include either name or slug in the include parameter using wp_list_categories?
- multiple values in an array for category__and does not work with WP_Query
- How can I filter posts by tag on the fly
- Posts of specific category on page and excluded from index.htm
- Advanced permalinks structure
- How can I include custom category and tag base in template files?
- Custom menu with categories and tags
- Filter products on category AND tag
- Automatically adding tags and categories into Post Excerpt for searching
- Count how many posts have a specified tag AND category
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- echo $category[0]-> cat_name; shows only one category name
- When creating category, it creates automatically tag, or, when creating tag, it creates automatically category in same name
- Using heirarchial tags or Custom taxonomies
- Show posts from categories instead of tags
- Balance Tags to the_content Words Length
- Category and tag urls return 404 error
- How to echo Tags and Categories as plain text
- Categories and Tags Conflict after Woocommerce Installation
- How to exclude category and post_tag taxonomy while displaying custom taxonomy?
- 404 error when i try to search by category or by tag
- How to remove specific categories from tag archives?
- category__and works, but why?
- Page Type with Category Link
- A simple question regarding tags and categories
- foreach,having wp_query inside, breaks after showing one result
- How can I allow people to ‘subscribe’ to categories?
- How to add an empty entry to masonry?
- Own Custom Tags/Category page ( posts)
- WordPress Numeric Pagination with Query String [duplicate]
- Loops in category description
- How to create a category or tag available exclusively to the admins and not to the users?
- Printing direct descendants of a category with WP_Query
- Multiple Categories under one URL, where ‘Front Page’ is used already
- Modify functions.php to add a term ‘uses-theme’ set to theme name on post save
- List products from current category
- How to retrieve posts from parent category, splitting them per children when displayed?
- Moving Blog and Changing URL