Try Below code.This will helpful
$user_id = get_current_user_id();
$args = array(
'author' => $user_id
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
// Do Stuff
endwhile;
endif;
Related Posts:
- Conditional for single-{post-type}.php
- Get list of all registered post types slugs
- tag.php doesn’t work with tags on a custom post type post?
- How to build a complex page structure
- Proper way of making custom post type landing page or archive page
- If featured image doesn’t exist, show post content
- Getting a div content of a post in wordpress?
- Rename a current used post type
- Change permalink structure for custom post type
- Pagination gives 404 error
- add_meta_box: Datepicker like the one for postdate?
- How do you use JavaScript to detect the homepage
- wordpress 3.4 template files in subdirectories
- I am trying to output portfolio items with a picture. This code doesn’t seem to be working. What am I doing wrong?
- How to customize admin posts based on the user who is logged in
- Custom fields in Permalinks?
- Custom taxonomy template for multiple custom post types
- How to debug a blank page?
- Add/Remove current_page_parent class
- Adding `supports` array to WordPress custom post type
- URI returns a post when it should return a 404
- Importing posts from XML into custom post type
- Use different taxonomies in different custom post types’ permalinks?
- Custom post type menu missing after 3.0b2 -> 3.1.2 upgrade
- Email friend for each Custom Post Type posts on a page
- How to make custom post type feed title = taxonomies?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- Trouble with CPT Child 404
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- customise template to only show custom post type entries
- Programmatically rewriting slug through functions.php but returns 404
- limit value taxonomy based on previous taxonomy value wordpress
- Problem: wp_query outputs all images on site
- pre_get_posts for custom page builder meta box
- Pre-styling post content to display in lightbox
- Associating two custom post types
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- Get Post Types in admin
- How to query 2 custom post types that need to share a slug?
- Get rid of “trash can” for custom post type
- Create metaboxes based on custom post type
- Use the custom post type archive for taxonomies?
- Adding Multiple Post Types to Query [duplicate]
- Taxonomy template page not working
- Custom post type subtaxonomy template
- How I can made a custom post type to page templates?
- Running a custom query inside another cpt single and trying to grab a variable
- trying to show single post but displays all post on a custom post type
- List all posts in taxonomy term
- Metabox does not show in custom post type
- Custom rewrite rule takes place AFTER the generic category rule
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Create list from custom field comma separated values
- How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?
- How to fix the Post Preview Button (CPT & map_meta_cap)
- Fetch data from two custom post types and create multidimensional array for output to html table
- Restrict Custom Post Type per role in Dashboard
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Query filter by value in meta_value array
- Search CPT by tag ids
- Custom post type 404 category page
- Expire post to draft by date-picker custom field
- Edit the default ‘post’ custom post type arguments
- Post template with breadcrumb needs to show page navigated from
- Publishing failed. The response is not a valid JSON response
- add all blog posts to folder
- Auto generate excerpt from ACF field on a CPT that does not support excerpt or content
- ‘Simple’ Reservation System
- Combine multiple separate lists into one
- Custom post type, next and previous links by page title
- Reading Custom Post data so I can have user update Manually
- Custom post types – meta_query: search lesson which starts sooner
- How do I control what template is shown based upon Taxonomy Term?
- Custom Post type plugin is using theme single.php and style.css
- How to add a custom button to each field of a Custom Post Types Admin Screen
- Most efficient way of showing children posts?
- Capabilities and mapping required for a role to be able to edit other’s posts of a custom type, BUT only be able to edit their own blog posts
- Permalink Problem with Custom Post Type
- Automatically convert standard posts with custom fields to custom post types
- One Post with different content, depending on a Page
- How To Display Category list from Portfolio post type plugin?
- Custom Post Type tag taxonomy “Page Not Found”
- Remove custom post type slug but keep related category taxonomy permalink
- Adding CPT changes entire layout of my site except for the archive of that CPT
- page not found for example.com/custom-post-name
- Custom post type and custom taxonomies display
- custom fields not showing before get_header
- Why is my custom post type shown in the wrong place?
- Custom Post Type Pagination for Bones Theme [duplicate]
- Custom post type category page not working
- Turn off comments for given CPT checkbox?
- Categories in custom post types
- List a custom post type’s posts ordered by nested custom taxonomy
- listing custom post type category page
- WP Query – Can’t get posts with specific taxonomy
- Allow child pages with the same base as the CPT slug
- upload image with rest API to the media library