WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: The Events Calendar] List View Pagination Not Working (1 post)

  1. Paul Jarvis
    Member
    Posted 4 years ago #

    i've got a site and i'm using [Plugin: The Events Calendar] to generate both a list view and a grid view - the list view page works, but when i use the pagination code (unedited from the plugin), the URL goes from:
    /category/calendar/upcoming/

    to:
    /category/calendar/past/

    i have more than 1 page of upcoming events, so i want it to show the second page of events, not the past (which there are none). the logic here seems like it could be wrong, but i'm not sure how:

    <div class="nav-previous"><?php
    	// Display Previous Page Navigation
    	if( events_displaying_upcoming() && get_previous_posts_link( ) ) : ?>
    		<?php previous_posts_link( '<span>&laquo; Previous Events</span>' ); ?>
    	<?php elseif( events_displaying_upcoming() && !get_previous_posts_link( ) ) : ?>
    		<a href='<?php echo events_get_past_link(); ?>'><span>&laquo; Previous Events</span></a>
    	<?php elseif( events_displaying_past() && get_next_posts_link( ) ) : ?>
    		<?php next_posts_link( '<span>&laquo; Previous Events</span>' ); ?>
    	<?php endif; ?>
    	</div>
    
    	<div class="nav-next"><?php
    	// Display Next Page Navigation
    	if( events_displaying_upcoming() && get_next_posts_link( ) ) : ?>
    		<?php next_posts_link( '<span>Next Events &raquo;</span>' ); ?>
    	<?php elseif( events_displaying_past() && get_previous_posts_link( ) ) : ?>
    		<?php previous_posts_link( '<span>Next Events &raquo;</span>' ); // a little confusing but in 'past view' to see newer events you want the previous page ?>
    	<?php elseif( events_displaying_past() && !get_previous_posts_link( ) ) : ?>
    		<a href='<?php echo events_get_upcoming_link(); ?>'><span>Next Events &raquo;</span></a>
    	<?php endif; ?>
    	</div>

    suggestions? you can see the plugin/site in action here: http://sideout.230.ca/category/calendar/

    any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic