If you are trying to omit posts 1,3,5 from category 3 on your blog, you can use the following code
$query = new WP_Query( array('cat' => 3, 'post_type' => 'post', 'post__not_in' => array(1,3,5) ) );
The query results will not show posts with ids 1,3,5 of category 3.
Related Posts:
- Querying posts from current category, using a variable as array argument
- Sort Posts Alphabetically Based on Specific Category (Divi)
- How to show related posts by category
- Display all posts from specific categories on a page
- Query posts from current year
- Query only Posts from Both of Two Category?
- Order post by year DESC and month ASC
- Featured Posts for Category Pages
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Category Foreach keeps looping?
- WordPress custom Query for Posts in Category display posts multiple times
- How can I setup a relationship using categories in WordPress?
- posts_per_page option limits the number of Gallery items
- How to make multiple sections in home pulling posts category wise?
- Counter is skipping post when I still want it visible [closed]
- Query for first 3 posts to change the look and feel
- How to give classname to post if post has no content?
- All categories displays the same posts
- WordPress displays post on subcategory only
- How to get posts ordered by using their categories?
- How to display only one category in a custom post type?
- Getting posts from some categories plus some individual posts
- Get current taxonomy and display query accordingly
- How to fetch courses in all languages in WordPress?
- How to display particular categorie’s post which associated to specific user?
- Show 5 posts and than 3 posts offset with pagination
- AJAX load more posts not using correct category and repeating the same few posts
- How to run select query of post with category and tags?
- Query posts from newest category
- Sort Events by Venue Title – Sort Post set by related post ids
- Need help writing loop to display posts by categories in separate divs
- Sort / Filter Queries
- Ordering posts alphabetically by meta keys and title
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How to pass multiple checkbox values to wordpress query?
- Sort post by category using HTML Select tag
- Creating pages and getting their values from the database table
- How to limit post query to only return a total count of items with certain post statuses?
- Change from all posts to specific categories post on main page?
- Add a category to posts, that DO NOT contain two specific keywords?
- How to show related posts by detecting the current category?
- Display posts on a custom page from only a specific category?
- Add category attribute to custom recent post shortcode
- Grab next post title in archive page
- How do I control the fallback query after the original query returned cero posts?
- Newly created category does not show category
- Show category post with excerpt text
- Post of a specific category – not to be seen in paging previous/next post
- How to show main category related to that post
- Removing a post from the results of a WP Query
- Same sidebar in all posts as in the category
- Display selected category on post page
- Remove duplicated posts in the loop if post has more than one category
- How to show different categories in different pages?
- How do I list categories and the common categories for posts beneath those categories?
- Query posts from a specific category and selected tag
- Continuous listing from a custom field
- Latest Posts not in the right order
- Assign specific ads to specific categories/posts
- How to organise post by category and date
- Show post if in category
- How to display custom content in post with category XXX
- Order posts by separate menu order for different sub-categories
- Retrieve latest post by multiple categories with ID
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Displaying categories items among posts
- Displaying Results From Custom Taxonomy Query
- find posts with exactly 3/4 categories
- How to set a link to custom archieve page
- How to limit the number of results for all query_posts on mysite
- how to show posts on different pages if number of post per page is one
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to store post rating system data post independent?
- Displaying different posts Via wp_list_categories()
- Show a Category Specific Info Box
- How to use in_category?
- About number of posts in selected category
- Get first comment link on the post itself
- WP_Query retrieve custom posts but not the post showing
- How to Include a common category in a custom Category Search
- How to display only one post on first category page and rest on next pages?
- Use radio buttons & checkboxes for post categories
- Is possible to create a custom link that creates a post that’s already categorized?
- How to get all post titles starting with numbers and symbols?
- How to inject a post within a loop
- Delete old post with new post
- How to get alphabetic listing x other posts, based on first letter post?
- Displaying only posts from a certain category on my custom page template
- Special Query: Title, Terms, Content – %LIKE%
- Displaying posts by year
- I need to create a page or post hierarchy
- wp_query select if have comments
- Separate categories parents, childs and grandchilds in dropdowns
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Is it possible to have different header style blog titles in different categories?
- Older entries link within a category page
- single.php fires more than once after clicking on any post to view with different post id each time