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?
- Permalink issue with new blog posts > getting 301 redirect
- How do I check if I linked to a post before I delete it?
- How to use “Add link” pop up for a WordPress widget
- Where is the old post permalink slug stored?
- Difference between an archive and a page listing posts
- How to Check if a Page Exists by URL?
- Use category base slug in posts’ permalink
- has_archive=false on the default post type
- Clear cache when a post is submitted [closed]
- How to automatically generate a unique random slug
- Custom permalink structure only for default posts
- Portable Post Links
- Post slugs and images cannot have same name?
- Change permalinks for post type ‘post’ only
- WordPress: How to get the current logged in author page URL?
- Change the Slug of Post Type post to baseurl/post/%postname%
- Different permalink for posts and authors
- Pretty URL with add_query_var
- get_permalink returns default link
- Group Posts by First Letter of Title
- Create an “All Posts” or “Archives” Page with WordPress 3.0?
- Post Format Archive template name for theme folder?
- How to control which category will be picked for the slug of a post?
- how to get permalink using sql
- Change slug with custom field
- widget should display post archive by year and on click also by month
- Why can posts never have a number as the link?
- Is it possible to add a first and latest posts link?
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Get current users post URL?
- Display most recent post in category instead of archive?
- How to allow slashes in single posts when i click in the edit permalink button
- Single.php Active Category Class
- Navigation link to specific user page
- Post custom permalink results in 404 for archive page
- how to grab first link in post… and of course call it
- Some posts returning 404 instead of displaying post
- Custom post type single (permalink) throws a 404 error
- Load post content into div with ajax
- wp_list_categories link to first post of category instead of calling taxonomy template
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- Linking to page with all posts
- get_post_type_archive_link(‘post’) returns current category archive
- Random post permalink
- What Defines What Category A Post Picks (if in multiple)
- How to get the latest posting time of archived pages in WordPress?
- get_permalink executes link without https
- Permalink Settings: optional settings doesn’t apply to editor
- Custom post type permalinks breaking due to 3.1 bug fix
- How can a guest view the “Pending Review” Post?
- Create pretty permalink for a post knowing the permalink structure
- Changing my permalink structure – will new layout conflict with existing page?
- How to change the page break URL from ../post/2 to …/post/page2/
- Link post permalinks to subdirectory /post
- Link button is not working while editing a post in Firefox [closed]
- Adding a text link under the post title in the lists of posts
- Remove permalink from images when inserting into post
- Display all months with posts and inside each month show the 5 latest posts
- Display posts from #6 to #20 on archive page
- if I create ‘front-page.php’, then how do I link to post index?
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Setting up navigation links for posts (first, prev, next, last)
- Dynamically generate child-URLs for posts or custom posts
- Bulk update post slugs through database
- Category List (Archive) Page Template By Category
- Getting category posts from a certain year
- Adding parent pages to posts
- Plain permalinks not working!
- Direct link to “New post” in specific category?
- Yearly archive page for future year
- Which URL to enter into browser to show all posts in archive.php?
- How to display data in archive page?
- Guest Author – How to display posts on /author/ archive page
- Delete post by giving its link
- How to change permalink on post click on post listing page
- Changing Permalinks for Default Post type to reflect navigation
- WordPress not opening posts with only numbers if permalink is post_name
- Using permalinks, category slugs, and tag slugs
- Problem with permalink routing?
- Move first half of posts to one parent page, second half to the other page
- How to check a post exist when the permalink has post id in it?
- Archiving by academic year instead of calendar year
- After database migration, posts not showing up in dashboard
- Custom loop pagination links not working
- How to Next and Prevous Navigation Buttons on the end of the page with custom image Using Wp Post Navigation Plugin
- List category posts alphabetically on archive.php