Home › Forums › Calendar Products › Events Calendar PRO › How can I place a number of pages on the Next and Previous links?
- This topic has 11 replies, 4 voices, and was last updated 8 years, 1 month ago by Brian.
-
AuthorPosts
-
March 4, 2016 at 7:05 pm #1085446fifteen15studiosParticipant
Hi Modern Tribe,
You have Next and Previous buttons to cycle through events (or a collection of events). I’d like to display a number of events found using the certain search criteria. Can we do that? I’d also like to display a list of page groups between the next and previous pages like all other websites do, where we have something to the effect of the following:
<<First <Previous [1] [2] [3] [4]… [8] Next> Last>>
Is this possible to add this without a tremendous amount of modification?
Thanks!
BrendanMarch 5, 2016 at 3:44 pm #1085609kortrisParticipanti would like this too!
March 7, 2016 at 8:42 am #1085871BrianKeymasterHi,
Thanks for using our plugins. I can help out here.
We do not have a feature to do numbered pagination and we are limited by our terms and conditions on supporting features outside of what the plugins ship with.
There are WordPress functions that might help out, but not sure if they will work on a event date based query.
This is the WordPress function:
https://codex.wordpress.org/Function_Reference/paginate_links
And you can modify our templates following our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
Let me know if you have any follow up questions, but we are limited in providing much more then this.
Thanks
March 7, 2016 at 10:28 am #1085927fifteen15studiosParticipantYES!
HOLY WOW THAT WORKED!
THANK YOU FOR THAT! If you want to use this with tribe, just use the variables provided to adjust the page variables setting.
This is the PHP I used:
<?php $args = array( 'base' => '%_%', 'format' => '?tribe_paged=%#%'/* 'total' => 1, 'current' => 0, 'show_all' => false, 'end_size' => 1, 'mid_size' => 2, 'prev_next' => true, 'prev_text' => __('« Previous'), 'next_text' => __('Next »'), 'type' => 'plain', 'add_args' => false, 'add_fragment' => '', 'before_page_number' => '', 'after_page_number' => ''*/ ); ?> <?php echo paginate_links( $args ); ?>
I added this to my header, but you can add it just about anywhere. Notice how I commented out the rest of the variables. You can changes these if you want. Yes. Thank you!
I hope this helps you guys! 🙂
Now to fine-tune it, add it to my content section, and add some CSS.
Brendan
March 9, 2016 at 8:14 am #1086658BrianKeymasterOk so essentially you used this as the coding:
<?php $args = array(
'base' => '%_%',
'format' => '?tribe_paged=%#%'
); ?>
<?php echo paginate_links( $args ); ?>Thanks for sharing!
March 9, 2016 at 1:55 pm #1086873kortrisParticipanthello, this is a very interesting feature that i was looking for could you please tell me where i ahave to add the code you provide?
Thank you in advance
- This reply was modified 8 years, 2 months ago by kortris.
March 10, 2016 at 8:09 am #1087179BrianKeymasterHi,
You can add it to this file here:
plugins/the-events-calendar/src/views/list/nav.php
After you move it to your theme here:
yourtheme/tribe-events/list/nav.php
Following our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
From there you would have to style it the way you would like with css.
Cheers
March 18, 2016 at 1:59 pm #1091195Jesse SimmersParticipantThis works great if you aren’t using the filters plugin.
If I go to my main event list page I see that I have 14 pages and pagination works as expected. I then select a filter (I have category and taxonomy filters shown) and the page reloads with the filtered events. I see that the filter modified the URL to include my selections like so:
/?tribe_paged=1&tribe_event_display=&tribe_eventcategory%5B%5D=36&tribe_tags%5B%5D=5
I scroll down and see that I now only have 5 pages so it appears to have worked BUT clicking “2” or “Next” takes me to /?tribe_paged=2 which completely removes my filters from the URL.
If I don’t click “2” or “Next” and just refresh the page it will reload the same page with my filters still in the URL but NOW the pagination links include my filters and work exactly as they should. If I modify my filters I have to go through the process again of refreshing the page for the links in the pagination to include my filters.
I am thinking this has to do with the AJAX loading since the URLs for the pagination are already set and the filters only update the events shown.
How would I go about including taxonomies and categories in the pagination URL?
March 21, 2016 at 5:46 am #1091711BrianKeymasterHi Jesse,
I do not have any information to help on this. That is a customization and beyond what we can support.
I do not even have good information on where to begin on something like this as my first impression is you would have to make a complete custom pagination system to do what you want.
March 24, 2016 at 4:51 pm #1093764kortrisParticipantSo i have to add the code both to the yourtheme/tribe-events/list/nav.php and at plugins/the-events-calendar/src/views/list/nav.php ?
Thank you in advance
March 25, 2016 at 5:32 am #1093897BrianKeymasterHi kortris,
You want to put the coding only here:
yourtheme/tribe-events/list/nav.php
As it will be overwritten in the other location.
Cheers
March 28, 2016 at 5:30 am #1094697BrianKeymasterI am going to go ahead and close this thread as we have provided all we can for a customization.
If you need help on this or something else please post a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘How can I place a number of pages on the Next and Previous links?’ is closed to new replies.