Dynamic archive of posts by date

Please note that I have now resolved this issue. For whomever is interested, please find my code below (I’ve included everything to a shortcode to facilitate adding it anywhere I want):

function archiveday() {
$x=1;
    do {

$result = date('l jS F Y',strtotime("-$x days")); 
$year= date('Y',strtotime("-$x days"));
$month= date('n',strtotime("-$x days"));
$day= date('j',strtotime("-$x days"));
$my_query2 = get_posts("post_status=publish&post_type=post&year=$year&monthnum=$month&day=$day");

        if ($my_query2){
            echo '<a href="http://EXAMPLE.COM/'.$year."https://wordpress.stackexchange.com/".$month."https://wordpress.stackexchange.com/".$day."https://wordpress.stackexchange.com/">'.$result.'</a> ('. count($my_query2).') <br>'; }
        else {
            echo $result .' ('. count($my_query2).') <br>';}
    $x++;}
    while ($x<=10);

        wp_reset_postdata();
}
add_shortcode('archive', 'archiveday');

This now outputs the below:

enter image description here