Use get_comments()
and pass the post ID as parameter:
$comments = get_comments(
array (
'post_id' => 343
)
);
foreach ( $comments as $comment )
{
// Just to give you an idea of the available data.
// You will probably do something better with it. :)
var_export( $comment );
}
Related: Bug #20572 ($post_id
not passed to comment_open()
from comment_form()
) was fixed just two days ago.
Related Posts:
- Opinions and recommendations on the best barebones base theme [closed]
- Dynamic template serving, change theme_root using add_filter from current theme
- How to override the “inc” folder (or any folder) in a theme using child theme?
- Is it possible to access Gutenbergs reusable blocks in CPT block templates?
- Loading template files from a subfolder in my theme?
- How do I put my comment form above the comments?
- WordPress as Backend, Laravel Front End: How to connect Routes?
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Can I obtain differents links for different installed theme?
- WordPress ignoring specified template for front page. Why?
- Can I apply a WP theme to a specific custom page template?
- WordPress Fatal error: Call to undefined get_header() in index.php on line 15 [closed]
- Change Theme from Plugin based on query_vars
- How to add template to theme in WP
- Added a new template file to a theme – get Call to undefined function error
- How to find a file in WordPress themes [closed]
- Display a specific dynamic sidebar widgets on a specific page
- Child theme Page Template not loading
- Hide default “Recent Comments” Widget if there are no comments yet
- Creating new templates in child themes breaks layout
- Get WordPress to use another custom “author.php” file (“custom-author-file.php”)
- Search form not finding content in template page
- Selected template is not respected for home page in WordPress
- Putting two themes together to create a complete site
- Is there a way to upgrade a theme without losing custom templates?
- Need help with making a website where user can add products
- Advantages of wordpress theme vs wordpress as a backend only [closed]
- What’s a good way to unenqueue all scripts for a single template page?
- Problems to disable the comments for my statics pages
- Using the same database on another Subdomain
- WordPress TwentyTen Theme Incompatible with Theme Unit Test
- Trying to fix a website that was built with WordPress and then taken off of it
- Remove Commenting on Certain Pages
- linking to an svg through comments_popup_link
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- Does Jetpack store comments in local database also? [closed]
- Comments not displaying after changing theme
- Create Custom Attachment Template That is Processed from Plugin Folder?
- Multiple sub directories for theme template pages
- How to remove the tripadvisor logo from the wordpress theme?
- Unable to thread comments because of custom comments.php file
- Please help me clear my confusions about WordPress
- WordPress 2022 template, how to see the blocks added in post template on post edit?
- Can I use non-wordpress themes in WordPress?
- WordPress keeps switching back to empty template
- How to edit the default comment title?
- Removing a widget via theme editor
- How do I bring a page template into a new theme with separate styling?
- 12 column grid layout
- Theme Dev | Convert Template to Theme
- Lost for direction on how to continue building a theme
- Revamping a WordPress mirror site – and I don’t know where to start!
- What is the template file for topic layouts in bbPress?
- Theme comment callback results nothing
- Will this js code work in a page template?
- How to find out which template the HTML content comes from?
- Create a child Theme or custom Theme
- How to modify/ customise NextGen Gallery’s templates? [closed]
- wordpress template page Usage [duplicate]
- Overwrite template-tags.php in child theme
- What happens to bespoke page template references on theme change?
- How to add sidebar to homepage programmatically?
- Get header/footer list for a theme
- Homepage not loading correctly, only after refreshing
- How to clone a theme template from within WordPress? [closed]
- What theme is good for posting code? [closed]
- How to see files in directories in “Edit Themes” screen
- WordPress generating 404 on .mp4 file in theme folder
- Editing theme files and access to the Code pages only to super-admin?
- Current theme broken – after server and domain migration
- Categories for Pages Not Saving in Admin with Custom Categories Metabox?
- Weird post pagination url redirect
- How get Themes list via REST api?
- Activate a new WordPress Theme Only for Admins
- Theme Editor Not Showing
- Pros and cons of using Backbone for WordPress theming [closed]
- Can I create multiple instances of the BuddyPress Activity Stream with separate themes? [closed]
- Can I rename a theme’s folder and still receive updates?
- Child theme not visible
- How to load parent theme style.css?
- How to setup a new WordPress theme without deactivating the current theme?
- WordPress is not able to change themes
- Where all are child themes recorded when they are created in WordPress
- I have some doubts regarding how to implement child theme
- Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10)
- how to remove category nav from Bueno (WordPress Theme) header [closed]
- (FES EDD) New vendor submission page is blank
- customize color in WP child theme doesn’t saved
- How to make “upgrade safe” theme for a plugin?
- How to install themes with the demo content?
- Jetpack CSS .screen-reader-text breaks mobile menu [closed]
- Error when using ‘continue reading’
- How to update theme to specific version
- Hi everybody, I have a problem of search box
- get_comments_number() returns 0
- How to fix Scrape key check failed on WordPress VPS?
- How to fix Gutenberg with SiteOrigin page builder deleting content when editing
- Change whole theme depending on resolution
- Include root files into header files
- Fatal error Class-wp-hook, again, but not sure what’s triggering it