here you go,
The following returns all posts that belong to category 1 and are tagged “apples”
query_posts( 'cat=1&tag=apples' );
Add this inside the page before the loop
change ‘1’ and ‘apples’ to whatever category and tag you want.
If you must use query_posts()
, make sure you call wp_reset_query()
after you’re done.
look here for more info,
Related Posts:
- Order post by year DESC and month ASC
- how “manage_posts_custom_column” action hook relate to “manage_${post_type}_columns” filter hook?
- Filter Custom Post Type by Category with Ajax
- How to add Tags Filter in wordpress admin dashboard
- Display posts with tag that matches current post title
- Print all the tags from a custom post type Please
- How to allow visitors to filter posts by multiple taxonomies
- WordPress query_posts by tag doesn’t work anymore(?)
- Conditionals if tags exist?
- query post limits
- Add post tags to previously created custom post type
- Trying to exclude custom posts based on date, while sorting by custom field
- get posts, run a custom query, and join the results
- How to add a custom class attribute into code wrapper? [duplicate]
- Tag for custom post type
- Remove status ‘archived’ from the default post and page view
- show only one category and filter by tag
- How to modify specific parts of a post content in WordPress
- How do I control the fallback query after the original query returned cero posts?
- Custom Post Archive Page not working
- Hiding Draft Post In Admin
- Display tag image in post using Taxonomy Images plugin index.php
- What is the filter or hook to add admin controls to posts on the front end?
- Display multiple custom taxonomy values on single custom post types page?
- Blog post per page setting conflicting with custom WP_Query?
- Change post order random through out the entire WordPress
- Adding custom fields to bbpress reply form
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Move first half of posts to one parent page, second half to the other page
- Adding buttons to Add New Post and Add New Page
- use wpml_post_language_details function other plugin based on $post->ID [closed]
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- How to hide html tags on revision comparison pages?
- Add filter by custom field to block of posts
- CPT archive redirects to single post
- Ajax post filters not working
- Default to ‘all’ view on the ‘edit-post’ screen for authors
- Show posts by a custom post author
- Add multiple tags to multiple posts
- Help with Taxonomies
- Display Meta Values in Custom Filter – Admin Custom Posts
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- wp-cli post create & media import issues
- How to filter my search in post if contains a word in title, content or excerpt?
- More then one menu items are assigned with “current-menu-item” class
- Update post_content everytime a custom post is opened in backend
- How can i limit the number of posts created per category?
- Search results posts_orderby and ID
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Posts and Attachments with “Published” status in Search
- Random ajax load only works with posts_per_page set to -1
- Automatically add date to the auto generation of post slug
- Permission issue with custom post type – not added to menu – by plugin
- Duplicate Custom Post Type and Taxonomy Slug
- How could I change my Permalink from blog to custom structure? [closed]
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- WP Admin register taxonomy and post type performance
- Add a custom meta box in the post options that loads some html code in the header
- WP_Query: Mixing category__in and tag__in together
- Display an author’s posts on his own author page
- Static posts page with home.php
- Calling Different Custom Post Timestamps in a table
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Admin – create custom post status and display above table
- Multi row post list
- custom post template file not shown, instead all the time 404.php
- Set Default Category to Username
- How to add tags (custom taxonomy) to post class css?
- How can I hide tags on a child-category page, if that tag has not been used?
- posts_per_page option limits the number of Gallery items
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- How to make multiple sections in home pulling posts category wise?
- Thumbnail & Category link aside post
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- How to get Tags with specific post id
- Redirect to another page using contact form 7? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- How to order posts in an arbitrary order?
- Trying to alter the post_content through the_post
- Display Posts on Custom Page
- How to include my own css in post
- How to get posts from a current post’s month?
- How to get a post’s content? [closed]
- How Do I Get My Post Tags to Alphabetize?
- Wrong post title displayed from loop
- Custom post types related to same custom post type?