In your Loop, whether for a ‘single’ page or an ‘index’ page, check the post author against the current user ID, and only display the post if they match. Assuming you are using a typical WordPress Loop, something like…
global $current_user;
get_currentuserinfo();
// start of the Loop
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
if ($post->post_author != $current_user->ID) continue;
This also assumes that you are inserting your Custom Post Type entries correctly so that all of the data is populated as it should be.
Related Posts:
- how to group custom post types
- Page as child in custom post type slug?
- Number of pages – multiple (custom) post types
- Limit widget to a specific registered sidebar
- Restrict a Post Types Post Status
- WP_List_Table Inside Metabox Not Working on Submit
- How to filter post data with AJAX on page?
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Hook when adding or editing a specific custom post type? [closed]
- Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?
- Assign category to front end post
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Possible to add meta box to edit.php pages?
- Taxonomy structure of Sport site
- How can I add a column in the wp_list_table of the admin area?
- Custom Post Type with static page for archive
- How to filter the description of a custom post type
- Automatically adding meta data to posts or multiple query help
- Make Custom Post Behave Like Normal Post?
- Trigger “unsaved changes” dialog for custom post meta changes
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- How does the $post_type global variable work?
- how to check if custom post type exists in wordpress
- Sending an email when a CPT is saved/updated (NOT when it’s created)
- flush_rewrite_rules on every register_post_type?
- Archive slider for CPT
- Custom taxonomy in custom post RSS feed
- Set up Custom-Post-Type Author Archive
- How to display product subcategories into my custom post type single page
- Adding code to a post under a custom post type
- Custom Taxonomies not appearing in Admin
- How to create custom post type like Page
- Notice: Undefined index: error and understanding wordpress
- Problem loading custom post type admin page
- Display content based on a users login
- Custom Post Type Capabilities
- Can taxonomies of custom post types be used with category actions?
- Advanced Custom Fields Plugin – Conflict with Custom Post Type Default Editor
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Custom post type as home page with custom url
- Show image gallery from a custom field
- Creating a Custom Post Type
- WordPress Doesn’t Generate Taxonomy Archive
- WordPress randomly shows 404 errors
- How to make front end form only accept certain values
- Associate multiple users to custom post type
- Organize WordPress site, so it can maintain with huge database
- How do you create a custom template to display a category with an image and related posts below?
- Remove permalink for custom post type
- custom post data – how to
- How can i link a custom post type thumbnail to intermediate size
- Category archive in with conjunction with custom post type is empty
- What do the numbers mean at the end of add_action(‘save_post’)…?
- post_type_link Filter – Too Few Arguments
- Select2 AJAX and WP Query Returns ALL and does not filter
- WordPress rewrite url
- Archive Page for Multiple Custom Post Types
- add pagination to custom category posts
- How to create object in wordpress?
- Reusable metabox backend and frontend
- How to loop through custom post type items and add them to a slider if they exist
- Modifying Dashboard edit.php
- How to import database table as custom post type and custom fields?
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- Fill custom fields when saving custom post types
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- pagination for custom post type archive page
- Add custom posts to submenu automatically
- Is it possible to get the specific content on the search page?
- Custom taxonomy: on the taxonomy term page show other taxonomy terms
- Search for custom field input of a custom post type in ajax live search
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Make bootstrap 5.0 carousel dynamic using ACF and CPT UI [closed]
- WordPress custom post type as homepage with homepage url
- show label text of select option rather than its value in cmb2
- Custom post categories are not displaying on the page
- How to select meta key in custom database query
- localize_script or rest api
- Search result based on URL
- Widget area for individual posts (custom post type)?
- Custom Post Type with Subfolder in Custom Theme
- Link two different post using there post_id in post meta
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- How do I extract the contents of a CPT’s custom field for all posts?
- Keep same archive.php for post from archive?
- Use one template for different custom post types with the same markup
- Events with multiple event dates + permalink for each date
- Custom Post Type and Custom Taxonomy not connected
- After rewriting post type’s URL, the number of queries has increased dramatically
- Custom field totals
- How to Associate Posts with Pages
- How to query custom post then display sections by meta value
- Prevent users from changing post status
- How do I paginate a custom post type listing on a custom template page?
- What is the code for showing Custom Category and Subcategory Page?
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Assign a tag to custom post type using a query
- Categorizing Custom Posts in Bulk Based on Title