You can use get_posts
to get a list of posts, and then the WP_Post
member variables to get and display the data that you need
You van do something like this. You can refine it as you need
<?php
$args = array( 'posts_per_page' => -1);
$posts= get_posts( $args );
if ($posts) {
foreach ( $posts as $post ) {
setup_postdata($post);
echo '<p>' . $post->post_title . '(' . $post->ID . ')' . ' was posted on ' . $post->post_date . '</p>';
}
}
This will output
TEST POST SUB(312) was posted on 2014-05-29 15:47:26
Related Posts:
- How to create REST Based JSON API(how to modify the code below)?
- How to use “Add link” pop up for a WordPress widget
- Adding additional data to WP_Post object
- Passing a hardcoded page/post ID into `get_post`
- Use an attachment in multiple posts
- Query Post Preview Updates from the WP API?
- Every possible way to get data (posts) from WordPress
- WordPress REST API not returning all posts
- How can I get the media inside a post?
- How to disable WordPress blog folder
- Call Web Services on post first publish
- Change post-slug using wordpress API? Change permalink of a post using php / jquery?
- Creating a WordPress Post via REST API – HTML or Markdown?
- Get timestamp of latest post in C#
- Pull in posts using post meta for REST API
- exclude particular category in api
- Is update_post_meta used when save_post action hook is invoked?
- Get origin or context of a how a post got created and/or updated
- how to fetch posts from Api in chunks or parts?
- REST API Working for GET but not for POST?
- Problem with wp_insert_post()
- Surrogate ID for posts, is there an alternative field in the posts table?
- How to get a list of all posts and their categories?
- Server 500 error when updating post using block editor
- ‘403 Forbidden’ when publishing a post containing different blocks
- WordPress Rest API Post request from AMP
- Modify loop to include all post statuses not just ‘published’
- Custom post type template not called
- How to convert return type of ‘get_posts()’ same as ‘wp_get_recent_posts()’?
- Nothing appears using get_the_excerpt() in category.php
- Random order of the 5 most popular posts
- SQL trigger failes with post_content
- WordPress infinite post cycle
- Difference between modified post and new post
- Get from the dashboard the ID of the current post being edited
- Displaying dynamic content (blog posts/portfolio) on a static homepage and keep the blog post styles
- How to give priority to page than to posts permalink structure?
- WordPress infinite post cycle problem
- How to use Categories of custom post type
- Custom author search
- How to add multiple(but specific) posts to different areas in one page?
- Posts only showing on /localhost/wordpress/ and not on other pages
- WordPress post filter
- Page 2 has no posts?
- WordPress not showing recent posts
- WordPress template next_prev
- Don`t show short description on a single page
- Compare date of user’s last posts
- Only get post_id [duplicate]
- Disable `create_post` for built-in post type
- How to get all posts in gallery post format template
- Append a random string to a post permalink
- im trying make a function to auto correct posts when i open the posts in the backoffice
- how to create other sizes of original image in one go wordpress uploads
- Multipage Post URL correction
- alt of attached image in post / pages
- WP Pages: Add checkbox, save and display
- How to control Post view count incresing in sidebar widget posts too?
- Display post in visual composer with custom html
- Set multi posts random categories and tags
- display content in multiple columns
- Adding post date to ACF field
- Point users to a specific url directory for some posts
- Point to a page when there is no results
- My custom query is displaying random posts in random order
- Output wp_link_pages as raw url
- Keep highlight on menu item with post pages
- Can’t get post_updated hook to work
- Repeating post how to solve this
- How to test if user is filtering post list in dashboard
- Get the category of post
- Shortcode: How to add custom posts?
- Only show related posts when another post has same term
- Precedence of page permalinks over woocommerce product category links?
- Add new post only in assigned category
- single- and archive- templates not being applied to custom post types, not even after flushing permalinks
- Display Posts by Categories
- Hide Admin posts & pages in Dashboard
- Post & Category Archives URL structure
- Creating Ordered Query using Meta_key
- Sort Events by Venue Title – Sort Post set by related post ids
- Is there a global page/post/product/anything ID?
- How do I create a ‘selection’ criteria list’ that will then dictate which posts are generated when the user presses search?
- WordPress each user has each content for a page,how to do that?
- How to get post count including nested categories
- WordPress Request Post All Post ID in a Loop? [closed]
- Fixing the WP Post Object for Custom Route
- Post URL duplication adds numerical value
- How can I alternate styling of images in a post? [closed]
- Changing the Category for all posts of an Author
- Auto populate custom fields by post date
- Bulk posts from DRAFT Section
- Is it possible to display QUICK EDIT as default for all posts in wp-admin/edit.php page?
- Custom layout manager for posts
- Add caption to thumbnails in content
- Posting a comment redirects admin/users to blank page
- Custom Taxonomy From Database
- WordPress URL question
- Creating widget – ask for selecting a post in the admin panel
- Multiple Custom Post Type loop logic