widget to output a link to archive view

get_archive_link() is used to generate internal html links for output. If you want to link to archive page from single.php why dont you use get_post_type_archive_link

here is an example of how you can use this. it takes only one parameter (post type)

<a href="https://wordpress.stackexchange.com/questions/368468/<?php echo get_post_type_archive_link("movies' ); ?>">Movies Archive</a>
//here movies is the post type

Leave a Comment