Home › Forums › Calendar Products › Events Calendar PRO › Pagination Problems
- This topic has 7 replies, 2 voices, and was last updated 11 years, 8 months ago by
Barry.
-
AuthorPosts
-
July 28, 2014 at 10:32 am #526781
hypedev
ParticipantI have been having two problems with pagination on the ‘list’ view pages of my website.
First problem: The upcoming events page loads as expected, but when I click the ‘previous events’ button, another page loads showing the past events (which is what should happen) but also the upcoming events in a separate section below.
Second problem: Following on from problem #1, when I click the ‘next events’ button, I am taken to a page which says there are ‘no upcoming events’. It seems as though I am being redirected to the wrong URL at this point.
July 28, 2014 at 3:24 pm #528175Barry
MemberHi – sorry you’re having difficulties.
I’d love to learn more about your setup – for example, your upcoming events view looks very much like photo view – so my guess if you have extensively customized things here (and it looks great!).
Can you confirm though if this is indeed the result of your customization work? If for instance you revert to our default templates etc does the same problem still occur?
July 29, 2014 at 1:45 am #531176hypedev
ParticipantHi Barry,
I have customised the ‘list’ view extensively, yes.
I just reverted the template to the default, and while this fixes the first problem, the second problem still persists.
Have a look at the page again to see it with the default ‘list’ templates…
July 29, 2014 at 3:50 am #531763hypedev
ParticipantIn addition to this, since I have installed the Pro version of the plugin, none of my ‘single event’ pages are working (I’m getting a ‘Page not found’ message when I navigate to the page).
The same also happens when I attempt to navigate to the ‘week’ view (http://engineering.hypedev1.co.uk/events/week). With the week view, do I need to set this up somewhere in order for it to work?
July 29, 2014 at 7:13 am #532628Barry
MemberIn addition to this, since I have installed the Pro version of the plugin, none of my ‘single event’ pages are working (I’m getting a ‘Page not found’ message when I navigate to the page).
OK – solving this potentially could be as simple as visiting the Permalink Settings screen in order to trigger a refresh of WordPress’s rewrite rules, but as we try hard to stick to one issue per topic I’d ask that you create a new thread if you need further help with this/anything beyond the initially described pagination issues 🙂
I just reverted the template to the default, and while this fixes the first problem, the second problem still persists.
Great that we solved part of it at least 🙂
Second problem: Following on from problem #1, when I click the ‘next events’ button, I am taken to a page which says there are ‘no upcoming events’. It seems as though I am being redirected to the wrong URL at this point.
I’d like to note first of all that it still very much looks like a custom template (perhaps you restored it, or perhaps this is again a caching issue that you may not see if you are logged in).
That said, if I navigate back using the previous events link, then hit the next events link, there are a number of curious effects but I don’t believe any of these would manifest using our calendar without any customizations.
As an alternative way to tackle this, how about setting up a fresh install with nothing but our plugins (don’t even add your theme, initially). Does everything work as expected under those conditions? Assuming for the moment it does, begin adding all the components that make up the “real” site and test at each stage to see which introduce the problems you are facing.
I suspect much of this may relate to your theme or the event-related customizations within it, but if you have any doubt this would be a great way to get to the bottom of things.
July 29, 2014 at 9:45 am #533285hypedev
ParticipantBarry,
Regarding the permalink issue – I will have a look at sorting that out by doing what you suggested.
Regarding the first problem – whilst changing the template back to default does fix this, it doesn’t help me a whole lot, as I need to use my custom template. Can you take a look at my code and let me know where I’m going wrong?
Here’s the ‘list/loop.php’ template:
<?php
/**
* List View Loop
* This file sets up the structure for the list loop
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc.
*
*/if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?>
<?php
global $more;
$more = false;
?><?php while ( have_posts() ) : the_post(); ?>
<?php do_action( ‘tribe_events_inside_before_loop’ ); ?><!– Month / Year Headers –>
<!– <?php tribe_events_list_the_date_headers(); ?> –><!– Event –>
<div id=”post-<?php the_ID() ?>” class=”<?php tribe_events_event_classes() ?> box project”>
<?php tribe_get_template_part( ‘list/single’, ‘event’ ) ?>
</div><!– .hentry .vevent –><?php do_action( ‘tribe_events_inside_after_loop’ ); ?>
<?php endwhile; ?>Here’s the ‘list/content.php’ template:
<?php
/**
* List View Content Template
* The content template for the list view. This template is also used for
* the response that is returned on list view ajax requests.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/content.php
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc.
*
*/if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?>
<div id=”tribe-events-content” class=”tribe-events-list”>
</div><!– #tribe-events-header –>
<?php do_action( ‘tribe_events_after_header’ ); ?>
<div class=”tribe-events-loop hfeed vcalendar”>
<div id=”boxes” class=”cf”><div class=”grid-sizer”>
</div><!– Events Loop –>
<?php if ( have_posts() ) : ?>
<?php do_action( ‘tribe_events_before_loop’ ); ?>
<?php tribe_get_template_part( ‘list/loop’ ) ?>
<?php do_action( ‘tribe_events_after_loop’ ); ?>
<?php endif; ?>
</div>
</div><!– .tribe-events-loop –>
<!– List Footer –>
<?php do_action( ‘tribe_events_before_footer’ ); ?><script>
jQuery( document ).ready(function($) {var $container = $( ‘#boxes’ );
// initialize Isotope after all images have loaded, to avoid overlapping boxes!
$container.imagesLoaded( function() {$container.isotope({
// options
itemSelector: ‘.box’,
layoutMode: ‘masonry’,
masonry: {
columnWidth: ‘.grid-sizer’
}
});
});$(‘#boxes’).animate({ opacity: ‘1’ }, 1200);
});
</script><div id=”tribe-events-footer”>
<!– Footer Navigation –>
<?php do_action( ‘tribe_events_before_footer_nav’ ); ?>
<?php tribe_get_template_part( ‘list/nav’, ‘footer’ ); ?>
<?php do_action( ‘tribe_events_after_footer_nav’ ); ?></div><!– #tribe-events-footer –>
<?php do_action( ‘tribe_events_after_footer’ ) ?><!– #tribe-events-content –>
Here’s the ‘list/nav.php’ template:
<?php
/**
* List View Nav Template
* This file loads the list view navigation.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/nav.php
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc.
*
*/
global $wp_query;if ( !defined(‘ABSPATH’) ) { die(‘-1’); } ?>
<h3 class=”tribe-events-visuallyhidden”><?php _e( ‘Events List Navigation’, ‘tribe-events-calendar’ ) ?></h3>
<ul class=”tribe-events-sub-nav”>
<!– Left Navigation –>
<?php if( tribe_is_past() ) : ?>
<li class=”tribe-events-nav-previous tribe-events-nav-left tribe-events-past”>
<?php if( get_next_posts_link() ) : ?>
“><?php _e( ‘<span>«</span> Previous Events’, ‘tribe-events-calendar’ ) ?>
<?php endif; ?>
<!– .tribe-events-nav-previous –>
<?php elseif ( tribe_is_upcoming() ) : ?>
<?php if( get_previous_posts_link() ) : ?>
<li class=”tribe-events-nav-previous tribe-events-nav-left”>
” rel=”prev”><?php _e( ‘<span>«</span> Previous Events’, ‘tribe-events-calendar’ ) ?>
<?php elseif ( tribe_has_past_events() ) : ?>
<li class=”tribe-events-nav-previous tribe-events-nav-left tribe-events-past”>
” rel=”prev”><?php _e( ‘<span>«</span> Previous Events’, ‘tribe-events-calendar’ ) ?>
<?php endif; ?>
<!– .tribe-events-nav-previous –>
<?php endif; ?><!– Right Navigation –>
<?php if( tribe_is_past() ) : ?>
<?php if( get_query_var( ‘paged’ ) > 1 ) : ?>
<li class=”tribe-events-nav-next tribe-events-nav-right tribe-events-past”>
” rel=”next”><?php _e( ‘Next Events <span>»</span>’, ‘tribe-events-calendar’ ) ?>
<?php elseif( !get_previous_posts_link() ) : ?>
<li class=”tribe-events-nav-next tribe-events-nav-right”>
” rel=”next”><?php _e( ‘Next Events <span>»</span>’, ‘tribe-events-calendar’ ) ?>
<?php endif; ?>
<!– .tribe-events-nav-previous –>
<?php elseif ( tribe_is_upcoming() ) : ?>
<li class=”tribe-events-nav-next tribe-events-nav-right”>
<?php if( get_next_posts_link() ) : ?>
” rel=”next”><?php _e( ‘Next Events <span>»</span>’, ‘tribe-events-calendar’ ) ?>
<?php endif; ?>
<!– .tribe-events-nav-previous –>
<?php endif; ?>It seems to me that the loop of running more than once, which is why both the past and future events are showing up, when only the past events should be shown.
July 30, 2014 at 8:23 am #539955Barry
MemberHi – please note first of all that it’s best to share code via Pastebin or Gist (ideally, one paste per file) rather than posting it directly in the forum – apart from being hard to read a number of characters may be transformed and bits and bobs may even be stripped out.
In any case, that’s a lot of code to read through! Your list/loop.php template doesn’t look hugely different to the default version, albeit you’ve commented out a section. Perhaps you could isolate the problem to a single template and summarize the differences, then try to figure out exactly which element is throwing a spanner in the works?
While we’re happy to point you in the right direction if we can, the onus is primarily on you as the developer making these customizations to get to the bottom of situations like this.
September 4, 2014 at 8:33 pm #723559Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Pagination Problems’ is closed to new replies.
