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

Question

I am trying to get the page to list all my posts (post type = post) in archive.

I can do this with custom post types, with get_post_type_archive_link(), but using get_post_type_archive_link('post') to get the page url of all posts doesn’t work the same way.

Also using get_permalink() or get_permalink( get_option( 'page_for_posts' ) ) returns only the link of one post.

Example:

I would like to get a link like www.example.com/posts/ or other, in a similar way as the custom post type, when using get_post_type_archive_link('news'), retrieves www.example.com/news/.

Can I get a list of posts other than in the home page? Is this possible?

Thanks for the help!

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/link-for-the-page-archive-for-posts-like-using-custom-post-types-with-get_post_type_archive_link/">

Link for the page archive for posts, like using custom post types with get_post_type_archive_link</a>
0
, , , user38561 3 years 0 Answers 36 views 0

Leave an answer