Link for the page archive for posts, like using custom post types with get_post_type_archive_link

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.

tech