Set the “parent” parameter as 0.
$args = array(
'parent' => 0,
'post_type' => 'custom-post-type',
'number' => '1',
'orderby' => 'date',
'order' => 'DESC'
);
$comments = get_comments($args);
foreach($comments as $comment) :
echo($comment->comment_author . '<br />' . $comment->comment_content);
endforeach;
Related Posts:
- Why are the comments disabled by default on my custom_post_types?
- Why are comments and trackbacks still getting through for custom post types?
- Display Authors Comments on Profile Page
- List all posts commented by current user
- Custom Comment Types
- modify all posts of a category to “no comments allowed”
- Custom comment status possible?
- feed links for custom post type pages
- Seperating custom post type comments from regular blog posts comments
- Add comments meta fields to comments metabox on post edit screen
- Exclude post_type from admin comments_list
- Recent comments on author page?
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- Comment moderation on custom post types
- Automatically check “Allow comments” for custom post type [duplicate]
- How could I create a ‘private comments’ section on a custom post type?
- Disable comments from showing up public for Custom Post Type
- Custom Post Type loops and Disqus
- “Allow Comments” box cannot be checked
- Separate comment section for post type in dashboard
- Count all comments of a custom post type
- custom comments on specific post type
- Insert data on comment post
- get_comments not working on custom post types
- Custom Post Type Set Comments ON by default without show METABOX
- WordPress comments_open for specific user role or post type
- Add custom field in comments form
- Create another comment system for CPT
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Convert comments to Custom Post Type
- How to assign classes to all elements?
- custom comments form for custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- comment_notification_text filter for custom post type
- get comments by current user inside page template
- User-submitted reviews of different custom post types
- Check if user has comment on current post
- Enable comments on custom page type – option not showing in “customize” for theme
- Allow anonymous comments just in a custom post type
- duplicate comment section functionality and call it something else for custom post types
- Send email messages after comment was submitted
- comments hooks on custom post type
- custom comment fields on CPT
- unapprove comments on custom post type
- Enable comments for post when comments meta box removed
- Why will comments not remain open on custom post types?
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- How to change the comments form title based on post type
- Comments on posts with new custom post type redirected to another post
- Display custom posts, ordered by most commented, without duplicates
- get comments for custom post type
- How to create a discussion post when a custom post is created?
- Adding second comments.php for reviews
- Custom post type updated to support comments, yet comments don’t appear
- Comments not enabled for custom post types
- Turn off comments for given CPT checkbox?
- Author profile comments system
- Custom post type: can’t enable comments by default
- Comment moderation with disqus comments
- add comments custom fields after user is logged in
- Comments are not working on Custom Post Type
- Error 403 when posting comments to a custom post type from a different page
- Comments not working (error not allowed) on posts with custom post status
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Restrict custom post type to only site administrator role
- How to limit the number of terms (terms acts like categories)
- Removing custom post type from link search results
- Search multiple custom fields by using meta_query
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- How do I Make a custom post type get a custom post template in a plugin
- Check if current user has post in post type and is author role
- Including a custom post type in the Archives widget
- Set default option in dropdown of WP_Query?
- How can I add single catogory for custom post type?
- Automatically Insert Custom Field on Custom Post Type Publish
- Create XML files on post edit screen
- Creating a custom post type using a object oriented approach?
- CPT Search Form with Taxonomy filter & Or
- Custom WP_Query not returning results when querying custom post type
- Weird problem happening with custom taxonmy when creating/updating posts
- Random image from tag/custom type on sidebar
- Accept additional argument on custom post type permalink
- Include custom post type content in search
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- List Taxonomy Terms based on another Taxonomy
- Make a custom_post translatable
- If Post Meta Equals Current Title Conditional Advanced Custom Fields
- how to send email to administrator when someone edit post
- One Site. One Theme. Multiple Stylesheets without plugins?
- How to determine next custom post in hierarchy
- Change permalinks for custom post type based on taxonomy term
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Custom Post Type Category Displaying ALL Sub Categories as well
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- Display posts of a hierarchical custom post type excluding parent posts
- Site loads very slow for archive custom post type page
- Don’t display post if post has empty body
- Posts picking up old Permalinks, how to reset?