Use the post__not_in
Argument of wp_query like this
$query= new WP_Query(array('post_type' => 'rooms', 'post__not_in' => array(164));
Related Posts:
- Newer/Older posts links display same posts on every page
- How do I write this SQL statement for Posts written in last 24 hours?
- How to show related posts by category or custom post type?
- How to create posts (not post template) to be displayed on projects page?
- IF statement in a do_shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_template_part for custom post type content not working
- Loop on front-page.php
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- Shortcode not working with post counter
- Conditional for a Single Post That Belongs to a Category?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- display posts of custom post type with custom taxonomy
- Get post format
- Custom wordpress loop
- displaying content of custom post type
- Posts are not rendering perfectly [closed]
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- The loop does not show users
- How to fetch posts that are stored in the different table than (default) wp_posts?
- If/Else child list for Custom Post Type single template within loop?
- SEARCH QUERIES – REVERSE OUTPUT
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Display title of all custom posts from same taxonomy term on a custom post template
- Custom post Query and WordPress Post Query Clash
- Only show current category post
- How To Loop Through list with Custom Post Types
- How to create content automatically when a post is published?
- Turn post into simple slideshow
- Pulling in a particular post into a single page based on the post id passed into the code
- Styling first post using Advanced Custom Fields
- the_content() stop images being pulled through
- Default post showing more than intended
- button onclick with get_post_permalink
- Get next and previous 3 posts in a term in single post page
- List children on child post
- Restrict custom post type from appearing with ?post_types=
- Show custom post type filtered by category
- Loop custom taxonomy to get lists of cutom post types?
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- How do i calculate the total of values of custom fields in custom post types?
- Display random posts, but omit the post it is on?
- Multiple Loops On Custom Post Type Template?
- How do I do this with WordPress? Taxonomies?
- Custom loop with multiple taxonomy queries
- Disable block with taxonomies at post page
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Checking if Post Title is Unique as Loop Criteria
- Custom post type not displaying content from single-{custom post type} page
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- Custom post type multiple loop by taxonomy term
- Show a Category X’s custom post type on Category X archive page?
- Post image in WordPress not appearing on home page
- Paging doesn’t work?
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Meta query for custom post type ignored in main query
- Changing custom type name hides the posts
- Sort by alphabetical order archive.php page
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Display Ad on Specific Categories
- Custom Tag Description unable to display just below and outside of the Loop
- Hiding posts by other users and non-logged in
- Display all taxonomy terms, add class if term applies to current post
- Update Post Meta for a logged in user
- Return the latest post from a custom Taxonomy and Post Type
- Add custom field to Posts and sort by it
- Add custom post type settings to wordress default posts
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Get related posts of child term of custom post type
- Two Custom Post Types Many to Many Relationship
- Problem with displaying posts in the CPT category
- Group CPT posts by custom taxonomy
- JS innerhtml changing style when using AJAX
- Show titles, date of all posts on single category page
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Best way to style first post differently?
- A to Z List of Custom Post Type in three columns
- Custom post type, organized by categories
- Side effects of Script and Iframe in post
- What’s the WP way to load remaining custom posts?
- How to change the post type a theme shows by default?
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- WP Query with categories only shows one post and ignores the category
- What to and how to proceed with CPT to make DB small and efficient?
- custom post type category count shortcode
- Portfolio Page for Classic Posts
- Add post location with mile radius allowing search