Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi. I accomplished this manually:

    $currentyear = date('Y');
    $archiveyear = get_the_date('Y');
    
    $currentyear = intval($currentyear);
    $previousyear = intval($archiveyear) - 1;
    $nextyear = intval($archiveyear) + 1;

    then used it in the template like so:

    <?php if ($nextyear <= $currentyear) { ?>
    <a href="/blog/<?php echo $nextyear; ?>">Next</a>
    <?php } ?>

Viewing 1 replies (of 1 total)