How to get the date dynamically from archive.php to date.php?

It’s working very fine after I made some changes / adding on two php files function.php and date.php

function.php

function wpa_date_posts_per_page( $query ) {
    if ( !is_admin()
        && $query->is_date()
        && $query->is_main_query() ) {
            $query->set( 'posts_per_page', -1 );
    }
}
add_action( 'pre_get_posts', 'wpa_date_posts_per_page' );

date.php

<?php get_header(); 
            while (have_posts()) : the_post(); 
            echo the_title() . '<br/><br/>';
            endwhile;
            wp_reset_query();
get_footer();?>

archive.php

<?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12, 'show_post_count' => 1 ) ); ?><br/>

very special thanks to @milo

Leave a Comment