Skip Navigation

[Resolved] Stop rest of alphabet pagination disappearing when clicking on pagination

This thread is resolved. Here is a description of the problem and solution.

Problem:
Stop rest of alphabet pagination disappearing when clicking on pagination

Solution:
With this specific case as you are using view's filter wpv_filter_taxonomy_query , you need to make some adjustment to the filter code.

You can find proposed solution with the following reply:
=> https://toolset.com/forums/topic/stop-rest-of-alphabet-pagination-disappearing-when-clicking-on-pagination/#post-579428

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by morktron 6 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#579394

Hi, I'm trying to fix an issue with my alphabet menu - when you click on a letter of the alphabet then click on the pagination control buttons the rest of the alphabet menu disappears.

So on this site hidden link go to any letter with more than one page of results then click 'next' or 'previous' - like this page: hidden link

Noman helped me build it originally here: https://toolset.com/forums/topic/a-z-navigation-of-contemplations-cpt-grouped-by-subject-taxonomy/

Secondly, I'd like to add an 'active' class to the currently selected letter of the alphabet so I can style it to show it is selected. I hope you can help, many thanks

#579428

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please check now. I've changed the filter code as given under to exclude the view with ID 62.

add_filter( 'wpv_filter_taxonomy_query', 'prefix_modify_tax_query', 10, 3 );
function prefix_modify_tax_query( $tax_query_settings, $view_settings, $view_id ) {
   
	if($view_id != 62 && isset($_GET['wpvalphabet']) && $_GET['wpvalphabet'] != '' ) {
		$tax_query_settings['name__like'] = $_GET['wpvalphabet'];
	}
    return $tax_query_settings;
}

Also, to add active class, I've changed the code in view's loop output editor for alphabet view as given under:

 [wpv-conditional if="( '[wpv-search-term param='wpvalphabet']' eq '[wpv-taxonomy-title]' )"]
          	<li class="active"><a href="?wpvalphabet=[wpv-taxonomy-title]">[wpv-taxonomy-title] </a></li> 
          [/wpv-conditional]
          
           [wpv-conditional if="( '[wpv-search-term param='wpvalphabet']' ne '[wpv-taxonomy-title]' )"]
          	<li ><a href="?wpvalphabet=[wpv-taxonomy-title]">[wpv-taxonomy-title] </a></li> 
          [/wpv-conditional]

And finally, I've added the view to to output without cache:

[wpv-view name="alphabet-terms" cached='off']

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term

Now, if you can check everything should work fine.

#579730

Wow thanks Minesh, you are amazing! it is working perfectly 🙂 That code is beyond my skill set

There is just one other thing I noticed - when you click on a letter the Subjects View on the right doesn't update until you click on 'next'

hidden link

I'm not if there is an easy way to get that working? I tried the "Taxonomy term ID is set by the URL parameter" filter but couldn't get it to work.

Thanks again Minesh

#579847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Again it was a cache issue. I've added view as given under with cached='off' and I can see its working fine.

[wpv-view name="subjects-paginated-list" cached='off']

I hope everything is fixed now 🙂 Have a great day ahead 🙂

#580093

Aha excellent, thanks, Minesh, sorry I should have tried that cache solution myself, I just hadn't thought of it. Thanks Minesh, you've been super helpfull 🙂

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.