I have custom posts loop and at the bottom I want to add “View all” link that should lead to the page with all posts of that type.
The only solution I could think of is to have a template page for the post type and hardcode the link to it, but I am hoping for a more elegant and dynamic solution.
I’ve checked out the Codex and none of the functions seems to cover this.
Thanks
Bojana
In case
get_post_type_archive_link()
returnsfalse
, make sure that you have used the argumenthas_archive => true
when usingregister_post_type()
.I belive you are looking for this
get_post_type_archive_link('post_type');
. More info here: http://codex.wordpress.org/Function_Reference/get_post_type_archive_link