You need a tax_query
.
$live_tags = array(
'posts_per_page' => 5, // showposts has been deprecated for a long time
'post_type' => 'post',
'post_status' => 'publish',
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'post_tag',
'field' => 'slug',
'terms' => 'live',
),
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'candy',
),
),
'orderby' => 'date',
'order' => 'DESC'
);
$q = new WP_Query($live_tags);
var_dump($q->request);
Note that both the {tax} (string)
and showposts
arguments have been deprecated for quite some time. I would not recommend using them.
Related Posts:
- How to get the url to tag & category base set by the user?
- Different templates for different category tags
- altering theme – content generated by PAGES not PORTFOLIO
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Rewrite URL with category and tag combined using WP_Rewrite
- Use tag interface for hierarchical taxonomy?
- Using URL parameters, list posts from category and custom taxonomy
- Filter categories using tags
- Sticky posts on home page, search, tag and archives without plugin
- Are Categories, Tags and Custom Taxonomies any different in regards to SEO?
- Create subdomains for tags and categories
- Moving Categories submenu to Media, but still opens Posts menu
- How to totally get rid of Category in my blog?
- Root level category, tag, author and archive pages to work
- Showing all the posts in one page?
- Categories and Tags returning 404 on the sidebar when using ugly permalinks
- Is it possible to put tags and category information in the post as text?
- Script to duplicate categories as tags
- display most popular tags of category?
- Can paginate_links() be customized for a specific category or tag?
- Any way to assign Post Categories and Tags to Links?
- Edit the markup of categories list
- Categories: A Greenhorn Question on Strategy (Not Code)
- Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages
- How can I duplicate categories and tags?
- How to run select query of post with category and tags for API?
- Making a tourism information website [closed]
- How to check category of of custom post type or not
- Set a them for all subset of category
- Changing permalink from /postname/ to category/postname/
- How to call custom category field data in theme?
- Pagination is not working properly in Product Category/Tag pages
- How to display categories which contains particular tag?
- “Categories” for six authors [closed]
- How to “group” (categorize) the Pages together?
- Is There a Difference Between Taxonomies and Categories?
- Woo Framework: woo_cat_featured not populating
- Custom SQL Query: Get all posts with category id and a concated list of tags on each post
- Related Tags not in category
- scaleability of tags
- How to Remove a Title from All Category and Tags Page?
- How do I add a tag slug to a category URL to filter posts?
- Getting the category title / description returns first matching post?
- Show the amount of posts in a tag in a specific category has
- Echo text using is_tag
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- Allow user to select categories that will display in post loop
- Insert HTML content in WP Query at specific point
- Conditional category & tag statement
- Include either name or slug in the include parameter using wp_list_categories?
- List all posts of certain category which share some tags
- How to store category and tags separatly on wordpress?
- How can I filter posts by tag on the fly
- How to add icon over specific thumb
- Retrieve post tags from from main wp_query
- Advanced permalinks structure
- How to detect /category and /tag base pages?
- Custom menu with categories and tags
- WooCommerce shared categories
- display specific category when website loads
- Show the number of the post
- Automatically adding tags and categories into Post Excerpt for searching
- Return all Tags and Categories in Separate List
- How to filter tags by category?
- Count how many posts have a specified tag AND category
- Can’t display posts by filtering categories using isotope.js
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- When creating category, it creates automatically tag, or, when creating tag, it creates automatically category in same name
- Using heirarchial tags or Custom taxonomies
- Media Library Categories
- Balance Tags to the_content Words Length
- custom browse by
- Limit Category/Tag Dropdown To blog_id in Multisite Install With Global Categories/Tags
- How to echo Tags and Categories as plain text
- Categories and Tags Conflict after Woocommerce Installation
- How can I add metaboxs to Admin Bar?
- Split posts into 2 separate streams
- How can I add HTML classes for current taxonomy/term hierarchy into my pages to simplify styles?
- How to add an “All” category to the tag cloud?
- Change single.php template based on parent category
- Exclude posts with certain tags in category archive
- Getting Post Tags From Certain Categories
- How to remove specific categories from tag archives?
- Page Type with Category Link
- A simple question regarding tags and categories
- Lowest catagory link
- How can I allow people to ‘subscribe’ to categories?
- How to add an empty entry to masonry?
- Own Custom Tags/Category page ( posts)
- Loops in category description
- Tracking multiple tags or categories
- How to load jquery tag-it plugin into admin?
- Modify functions.php to add a term ‘uses-theme’ set to theme name on post save
- Category Archives: Show posts categorized in parent category only
- Query posts that have all the specified tags
- How can i hide the authors box from a specific set of categories and post types?
- Get all first images of posts in same category
- Moving Blog and Changing URL
- How to make /category/ URL load properly instead of 404 error?