widget to output a link to archive view


I am trying to go a different route as the suggested answer to this post didn’t work for me.

I am using child theme where I added nav widget with custom menu ‘archive’ containing only one page ‘archives’. I used <?php dynamic_sidebar( 'sidebar-2' ); ?> in my index.php and it links to archive.php view which I was kind of trying to achieve to output my posts in yearly format

enter image description here

PROBLEM: Child theme still adds this ‘archives’ page to Primary menu even though I have ‘Automatically add new top-level pages to this menu’ unchecked. I checked parent theme functions.php but didn’t find any function that can be the reason for that. I know this is the default WP behaviour.How can I stop automatically adding pages in my child theme?


get_archives_link first parameter description is “$url
(string) (Required) URL to archive.” does it mean it has to be URL to the actual archive page? can it be used to output a link to archive view (archive.php) from single.php?

below is a screenshot of the post footer from my single.php to illustrate how I am looking to output a link to archive view handled by archive.php

enter image description here

following is the code in my single.php post footer section

I’ve done extensive search on Codex but was not able to find a tag that can link to archive.php