Event List for today with PREV / NEXT links
-
I’m playing with this plugin on a demo site where the homepage shows a list of today’s events. Is there any way to have PREV / NEXT links on there that would navigate you to tomorrow, yesterday, etc.
I came up with some (probably inefficient) code to get the links formatted and outputted correctly, and resembling the links form the mini calendar also on the page:
<?php $currentUrl = $_SERVER["REQUEST_URI"]; $removeParts = array('wp','/'); $currentUrl_date = str_replace($removeParts,'',$currentUrl); $currentUrlnumbers = explode("-", $currentUrl_date); $currentUrlnumbers = mktime(0,0,0, intval($currentUrlnumbers[1]), intval($currentUrlnumbers[2]), intval($currentUrlnumbers[0])); $newUrl_date = date('Y-m-d', $currentUrlnumbers); $urlPath = get_bloginfo('url'); $tomorrowPage = date('Y-m-d', strtotime('+1 day')); ?> <?php if (is_page('25')) { ?> <a style="float:right; width:auto;" href="<?php get_bloginfo('url');?>/wp/<?php echo date('Y-m-d', strtotime('+1 day')); ?>">Next ></a> <?php } else if ($currentUrl == $tomorrowUrl) { ?> <a style="float:right; width:auto;" href="<?php get_bloginfo('url');?>/wp/<?php echo date('Y-m-d', strtotime($newUrl_date .'+1 day')); ?>">Next ></a> <a style="float:right; width:auto;" href="<?php get_bloginfo('url');?>">< Prev</a> <?php } else { ?> <a style="float:right; width:auto;" href="<?php get_bloginfo('url');?>/wp/<?php echo date('Y-m-d', strtotime($newUrl_date .'+1 day')); ?>">Next ></a> <a style="float:right; width:auto;" href="<?php get_bloginfo('url');?>/wp/<?php echo date('Y-m-d', strtotime($newUrl_date .'-1 day')); ?>">< Prev</a> <?php }?>
But clicking the links just gives me the {Warning: Cannot modify header information – headers already sent} error… becuase its not an AJAX call correct? CAn I get this to work.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Event List for today with PREV / NEXT links’ is closed to new replies.