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?
- Keep featured content post in homepage with original order
- using wp_update_post on save_post
- WordPress plugin to publish to multiple remote WordPress blogs
- How do you get all the urls of images attached to a post?
- Get names of authors who have edited a post
- How to wrap every image in a post with a div?
- Showing random content / pictures from earlier posts in a sticky post?
- Custom wp_trim_words() function not trimming right
- How to create post in WP network using WP-CLI
- How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?
- Function to show random posts from a category
- wp query with dynamic taxonomies and terms?
- How can I hide the sidebar from a specific post?
- move blog posts from one wordpress to another
- How to run a function when post is edited or updated using publish post action?
- Automatic value for custom fields for posts
- Display number of posts via adress bar?
- Display most recent post on homepage?
- Category Template: Need to display different content on first page of archives
- get current post id inside hook
- Display all posts that were published before full post on single.php
- How to make number of blog posts a custom field?
- How can you change all past posts’ images to link to none instead of the image file?
- Apostrophe in a possessive appears as an open-single-smart-quote instead of a closed one
- Add Read More Tag to a post content (Single.php)
- How to compare two posts including their meta fields on a scalable base?
- Why does my site often display 404 on subpages?
- Move comments only from one WP installation to another
- Only display sticky post or latest post in custom loop
- How to create a template for Pages?
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Add a variable in a post
- Loop parent terms {display posts} AND loop child terms {display posts}
- On what hook can I get the queried object’s final state?
- Is it possible to add a shortcode below post title?
- Edit the post title from the frontend
- Image behind the post’s title
- Get the most recently modified post date of most recently modified post
- Only allow posts with a specific term to only be viewed by other authors with the same term in their post
- Modify this line to give alternate format date?
- How to limit author related post listing ?
- Get all custom posts with a certain taxonomy
- How do I display the post_title with get_permalink?
- inserting a category into post
- Limiting the amount of posts retrieved by the loop
- Getting posts from some categories plus some individual posts
- How can I get posts from 9/13/11 to today with SQL? [closed]
- Direct some posts to only appear on a specific page
- How can I globally italicize list of texts in the UI database or Posts? [closed]
- How To import post If I have only subscriber access
- Get post publishing date from within custom HTML block
- Updates are not showing to public (New Posts , Theme Change)
- How to bulk Update URLs to new values?
- How can I make a post sub link?
- Display image gallery if more than 1 image
- get_next_post() not working with future post status
- Excluding category from post navigation in WordPress?
- Show post published live
- how i show manual data in a post
- Change archive results based on GET request
- Let Contributors Review only (Not Publish) Others Posts
- How to get meta data from custom category name
- Querying posts from current category, using a variable as array argument
- How to show view all posts from front page?
- Precedence of page permalinks over woocommerce product category links?
- Need help writing loop to display posts by categories in separate divs
- How to create a Top 10 Popular Posts Page?
- Multiple Post Repeat for Related Post Loop by Category
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- 2nd post different layout
- Print all content of a paged post
- 404 error on every post and page other than home
- Successive creation of over 1000 posts causes 404?
- Show last post of employee in his profile page
- How to disable edit post option? [closed]
- How do we display a certain category type on a page while hiding all others?
- How to remove a date from wordpress post
- Adding contents to my wordpress site