Wrong nav link in category

Home Forums Welcome! Pre-Sales Questions Wrong nav link in category

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1107050
    Romain Biard
    Guest

    Hi all,

    I’m facing an issue with nav links on a client’s website.
    I have a category called Friday Lunch Meetings, that I display right from the menu of the website. The problem is, when I click on the previous events link, I’m redirected directly to page 2, which is a pain in the ass, because if I want to see the events from last month for instance, I then have to click on next events. The users are completed lost.

    Do you have any idea why this link points directly to page 2?

    Here is the code of the file list/nav.php that I have in my theme folder:

    <?php if ( tribe_has_previous_event() ) : ?>
    		<li class="<?php echo tribe_left_navigation_classes(); ?>">
    			<a href="<?php echo esc_url( tribe_get_listview_link() ); ?>" rel="prev"><?php _e( '<span>&laquo;</span> Previous Events', 'tribe-events-calendar' ) ?></a>
    		</li><!-- .tribe-events-nav-left -->
    	<?php endif; ?>
    
    	<!-- Right Navigation -->
    	<?php if ( tribe_has_next_event() ) : ?>
    		<li class="<?php echo tribe_right_navigation_classes(); ?>">
    			<a href="<?php echo esc_url( tribe_get_listview_link() ); ?>" rel="next"><?php _e( 'Next Events <span>&raquo;</span>', 'tribe-events-calendar' ) ?></a>
    		</li><!-- .tribe-events-nav-right -->
    	<?php endif; ?>

    Thanks a lot for your help.

    Romain

    #1107335
    Brook
    Participant

    Howdy Romain!

    That definitely sounds off. In the usual installs you can see the “<< All Events” button typically takes you back to page 1. Example.

    If your site is doing something other than this then it is likely the result of a conflict. This guide walks you through how to test for a conflict, and then identify what is conflicting.

    If you need further help would you mind logging in so I can verify your support access? Or, if you don’t have/want a license (which includes a year of support) you should checkout the volunteer community on WordPress.org: The Events Calendar. It’s not the same level of support, but it’s free! We even check those forums once each week and help to the extent we can.

    Cheers!

    – Brook

    #1108136
    Romain Biard
    Guest

    Hi Brook,

    Thanks for this feedback.
    After digging in the views file of the plugin folder and comparing them to the on I had in tribe-events, I realized that the functions used where tribe_get_listview_link instead of tribe_get_listview_next_link and tribe_get_listview_prev_link.

    Thanks for your help.
    Romain

    #1108139
    Brook
    Participant

    Oh I missed that in your example code. I am happy you were able to narrow it down. Thanks for getting back Romain.

    Cheers!

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Wrong nav link in category’ is closed to new replies.