is there php code for next and previous year,month,day link in archive page i just need something like that

<-previous [year] next->
<-previous [month] next->
<-previous [day] next->

im creating a calendar and need those .

  • Have you tried anything already? – Krzysiek Dróżdż Jun 15 '15 at 9:12
  • Unfortunately no – Mouner Mostafa Jun 15 '15 at 9:22
  • Like your honesty. Just an idea, why don't you use the build in calendar widget as base for yours – Pieter Goosen Jun 15 '15 at 11:01

thank u all i just did a simple code to get what i want

$prevyear = date('2150') - 0001;
$nextyear = date('2150') + 0001;
$prevmonth = date('01') - 01;
$nextmonth = date('01') + 01;
echo echo get_year_link($prevyear)."<br />".get_year_link($nextyear)."<br />".get_year_link($prevmonth)."<br />".get_year_link($nextmonth)."<br />";
  • 2
    Could you explain why is this good solution? – Krzysiek Dróżdż Jun 18 '15 at 4:10
  • It's not a good solution. This assumes there always will be post for every month going backwards and forever in time until infinity. – Aeyoun Aug 31 '17 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.