Skip to content

Instantly share code, notes, and snippets.

@vbaimas
Last active September 18, 2019 10:29
Show Gist options
  • Save vbaimas/399f57284da982c6b15a9d8c5b80b444 to your computer and use it in GitHub Desktop.
Save vbaimas/399f57284da982c6b15a9d8c5b80b444 to your computer and use it in GitHub Desktop.
Scenario : If you have a custom posts loop and in the bottom you want to add "View all" link, then how you should lead to the page with all posts that type?
<a href="<?php echo get_post_type_archive_link ( 'your_post_type' ) ?>"</a>
@vbaimas
Copy link
Author

vbaimas commented Sep 18, 2019

Note: In case that get_post_type_archive_link() returns false, make sure that you have used the argument has_archive => true when using register_post_type().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment