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
- What does this PHP function code mean? [closed]
- Possible to change the URL for the regular post type without affecting the URL of other custom post types?
- How to add a button to custom post type’s posts-page
- How can I add a column/s to wp_posts table?
- post_row_actions for custom post type
- Pagination go to first page if i’m on last post
- Grossly inefficient wordpress loops!
- exclude custom post type by meta key in wp_query
- Get the title of custom post type in another loop
- get_queried_object error How to show post count by month in the taxonomy page
- Unable to get post content from custom post type loop
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Using pre_get_posts to filter one loop in a multiloop archive
- Custom Post Type Loop within Shortcode
- How to add post_type=value when editing that post type in the WordPress admin?
- Loop custom taxonomy to get lists of cutom post types?
- Show a Category X’s custom post type on Category X archive page?
- Sort by alphabetical order archive.php page
- Displaying Custom Posts on a Page
- Load Next Posts With AJAX not working with custom post type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Permalink misbehaving in Custom Post Types
- Display Only Certain Category In a Custom Page Template
- hide specific div on single.php [closed]
- wordpress lists similar type of posts in a custom post type
- Looping Through Categories of a CPT
- Auto post creation
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- list posts of two post types in a single template
- Displaying information from custom field on custom post type
- Display only a single CPT
- Control Loop Within Loop
- How do I enforce a specific custom post type on the loop
- Create a custom post type based on ‘Post’
- Show the categories the current post has
- Why is my custom post content only viewable when signed into WordPress?
- Add a form in every post and save data in post meta
- Pagination not working in custom post type. Help
- Limiting the Number of User Posts to Their Own Posts
- Correct way adding External classes to Custom Post type and output their methods to template
- Assign a Post to a User
- News post with multiple permalinks? When opened from different page
- Rest Api not working with Iframe in form data
- WordPress trying to query two custom types to get child from the parent
- Use WP pagination functions on a custom page template
- Event Manager: Events Deleted are still in DB as published but hidden in admin
- Rewrite url post_tag for custom post type
- Single Post (CPT) in two pages – Normal and Extended
- WordPress query in which condition uses custom field
- Limit or filter edit view in the dashboard to a specific ID only?
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- WordPress nested loop not working
- how to remove user name and date in post page
- next_posts_link returns same content of 1st page
- Post type cloud like tag cloud?
- Display posts from another page on home page in wp-editor
- Canot save post if any meta box was empty
- How to automate the creation of advanced layout article/post
- Display code if title of the custom post matches title of other post
- How to insert a post from a different post type after every nth post
- Complex Custom Loop with Includes
- How can I incldue a “private” post type in a loop for public users?