I use a shortcode:
function shortcode_article_list() {
$posts_array = get_posts( array('posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish') );
$output="<ul>";
foreach ($posts_array as $post) {
$a = explode(' ', $post->post_date);
$output .= '<li><a href="' . home_url("https://wordpress.stackexchange.com/") . $post->post_name . '.html">' . $post->post_title . '</a> (' . $a[0] . ')</li>';
}
$output .= '</ul>';
return $output;
}
add_shortcode('article_list', 'shortcode_article_list');
Perhaps there’s something you can use from it.
Related Posts:
- My posts section for logged in user
- Keep getting same permalink with WP_Query?
- Must permalinks always point to single post pages?
- change default post archive page link
- Removing rel=”nofollow” from links posted in Post Content
- How should I add links to other pages/posts from my post?
- How to handle broken links created by permalink/slug changes?
- Internal linking to posts permalink fail because of spaces and stripe at postname
- How to link post titles on page A to its posts on page B?
- Permalink Short code showing unnecessary link text inside the loop
- Prevent Archive URLs
- Modifying the permalink href for posts with jquery
- Read more link not working [closed]
- After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?
- How to use “Add link” pop up for a WordPress widget
- How to Check if a Page Exists by URL?
- Use category base slug in posts’ permalink
- has_archive=false on the default post type
- Custom permalink structure only for default posts
- Change the Slug of Post Type post to baseurl/post/%postname%
- Different permalink for posts and authors
- get_permalink returns default link
- Group Posts by First Letter of Title
- Post Format Archive template name for theme folder?
- How to control which category will be picked for the slug of a post?
- Change slug with custom field
- Display most recent post in category instead of archive?
- Post custom permalink results in 404 for archive page
- Custom post type single (permalink) throws a 404 error
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- get_post_type_archive_link(‘post’) returns current category archive
- How to get the latest posting time of archived pages in WordPress?
- Permalink Settings: optional settings doesn’t apply to editor
- How to change the page break URL from ../post/2 to …/post/page2/
- Link button is not working while editing a post in Firefox [closed]
- Display posts from #6 to #20 on archive page
- Setting up navigation links for posts (first, prev, next, last)
- Bulk update post slugs through database
- Getting category posts from a certain year
- Yearly archive page for future year
- How to display data in archive page?
- Delete post by giving its link
- How to change permalink on post click on post listing page
- Archiving by academic year instead of calendar year
- After database migration, posts not showing up in dashboard
- get_adjacent_post by language
- How could I change my Permalink from blog to custom structure? [closed]
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Can’t get full post title if there a spaces in title
- register_post_type permalink
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- Exists filter or action that change Add New Post link?
- Exclude a category of posts in author template
- Link post images to post
- Find out in which kind of archive am I
- Link from Post to Another Post Via Clicking on Words within Original Post
- Link to older links
- Problems with WordPress in subfolder, posts show a blank page
- How to create several Post pages
- Archieve page, Advertisement Every 3 Posts
- how to create a sub section in posts
- Categories Listing and Highlighting current category item
- Rewriting blog permalinks
- Edit post & page option does not display on latest wordpress
- WordPress 5: prevent link from displaying page title instead of URL
- blog post not accesible on click [closed]
- Some custom post types did not return an object
- Custom Post Types and Broken Permalinks
- view a list of 3 future post, from the nearest to the most far
- Custom permalink for wordpress page / post
- Category URL to use same string as Post URL Permalink
- How to give priority to page than to posts permalink structure?
- Append a random string to a post permalink
- Post & Category Archives URL structure
- is_archive() not working on selected “Posts page”
- Post List Widget with custom posts and editing the Read More Link
- How to display term in archive page?
- Posts in Page – How to customize the URL?
- Is there a way to change the complete URL of the blog post for a redirecting tracking link?
- WordPress with static posts page and custom permalink structure doesn’t find posts with numeric permalinks
- Can’t seem to replicate permalink structure for localhost development site
- WordPress rewrite url help needed
- Permalink of some posts change
- How to set a link to custom archieve page
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to mix pages and sub-categories in a url
- Changing permalink of custom category
- Overwrite URL on blog posts
- 301 Redirecting posts without %postid% (just %post_name%) in permalink to ones with %post_name%_%postid%
- How do I add /blog/ on my permalink without affecting the portfolio project types permalink?
- Display all posts from selected month
- Permalink remain the same on each page
- Automatically add class to link based on link text
- how to show all post with its contents
- How to change Permalinks only for Blogposts
- Permalink structure for two separate blogs
- Blog posts are not appearing as subs of Blog Page
- How can I fixe the article title problem?
- How to add paraent in Blog post URL in wordpress
- Change permalinks in posts via SQL