On your argument, exclude the current post using post__not_in
$args=array(
'post_type'=>'projects',
'orderby'=>'rand',
'posts_per_page'=>'1',
'post__not_in'=> array( get_the_ID() )
);
Related Posts:
- Exclude post_type from admin comments_list
- Exclude Custom Post Type & Pages From Auto-Tag Function
- exclude custom post type by meta key in wp_query
- Exclude the parent custom post-type posts only
- Exclude specific taxonomy term when using wp_get_post_terms
- is there a way to retrieve posts that do not have a featured image assigned?
- ‘exclude’ argument is not working with get_posts for a custom post type
- Exclude custom taxonomy term posts from custom post loop
- Exclude Custom post type from /blog page
- Exclude latest post from WP_Query taxonomy term loop
- Exclude a specific post in a Custom Post Type
- Skip latest 3 posts from loop
- How to display elements of different post types?
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- Cannot exclude particular post from loop of custom post type
- Pagination not working with custom loop
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- Breadcrumbs with Custom Post Types?
- order by meta_value serialized array
- bulk Update post_meta with default values
- Running a function on post content and CPT meta
- Get the post_type of current taxonomy or category page
- Output the slug and name of a CPT single post taxonomy term
- Slug for standard post post_type
- WordPress custom post type archive with description
- Custom post types – show specific posts
- Paginate_links links not working accordingly to how I do query the page
- Updating post title using wp_update_post
- Remove parent from custom post type
- Troubles with making a custom template for posts
- Custom Post Type and Labels
- related posts – pulling tags from a specific post type
- WP 3.0.5 – Custom posts matching 2 taxonomies
- Custom Post Type Loop within Shortcode
- How to add post_type=value when editing that post type in the WordPress admin?
- Change archive page template using pre_get_post
- Force documents to appear in Featured Image dialogue
- hide a certain custom field
- Query with no terms uses index.php template instead of archive.php
- Sort by alphabetical order archive.php page
- custom taxonamy and post type
- Custom post type archive page – Posts overview – with one modal for multiple posts?
- Getting categories of posts under a custom taxonomy
- Is it possible to to use custom post type types on a page with the same slug somehow?
- Custom Post Fields at the beginning of a Custom Permalink
- Add term to custom post type on draft
- When an unregistered user submits a form for a custom post type, send an email that lets them delete their post
- Custom Post Type Category Link
- get_page_by_title() doesn’t retrieve my post
- Show all tags on custom post type
- Meta data (Tags and Categories) for Custom Posts not showing.
- How to display custom field value on page?
- Display different information of a custom post type
- Update post if exist from PHP
- How to add a sub directory to WordPress single posts without affecting other post types?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to get the post terms from a child taxonomy
- Before saving post hook
- Adding Template Post Content
- Is it possible to sort metabox teaxtarea values?
- orderby parameter not working in custom query
- Which is the neatest way to have homepage articles and a blog?
- foreach loop inside the loop creating duplicates in output
- Display author box on just certain category posts?
- Content in WP Editor displayed below CPT shortcode [duplicate]
- Tag template not returning posts [closed]
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Permalink with hierarchy of Custom Post Types
- How do I set a post slug automatically based on taxonomy?
- Get a list of custom post type (property) when clicked on custom taxonomy 1 (rent or sale) from custom taxonomy 2 (city) page
- How to divide Subcategories into pages of parent category wordpress
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- How to submit custom post type front end form when a user buy specific product
- meta query condition don’t work
- Custom post type category returns null
- publish_post action callback not executed, why?
- Templating advice sub posts of a CTP
- Post display in separate page [duplicate]
- Two CPT: one is using part of the custom rewrite slug from the other
- Enable shortcodes on custom post type
- Only show current category post
- WordPress Contents Migration
- Pulling in Related Posts based on Post Type array
- Custom post type post taxonomies
- pre_get_posts action doesn’t work
- Query Posts From Multiple Post Types
- Bulk remove category from custom post type?
- Custom Post Types (Changing post style based on category)
- Page template anomaly
- Structure of custom post type / taxonomy?
- Notices when submitting custom post type from front-end
- Issue On Listing Woocommerce Parent Tag List
- show custom post’s post in two different divs [duplicate]
- Creating post custom field text area
- querying to custom field over ACF REST API
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- Calling custom taxonomies
- How do I add the “orange counter” next to a Custom Post Type?
- Custom slugs with dates & IDs on Custom Post Type