Problem:
The user would like to have a random order for posts in a taxonomy archive.
Solution:
The archive query is not built using Toolset, we'll need custom code in order to change the order on it.
add_filter('pre_get_posts', 'order_archive_by_title'); function order_archive_by_title($query) { if ( $query->is_tax( 'practice-area' ) ) { $query->set( 'orderby', 'rand' ); } return $query; }
Relevant Documentation:
https://developer.wordpress.org/reference/hooks/pre_get_posts/
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.
This topic is split from https://toolset.com/forums/topic/wpbakery-tabs-not-working/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - | - | 9: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: Africa/Casablanca (GMT+01:00)
This topic contains 2 replies, has 2 voices.
Last updated by 4 years, 3 months ago.
Assisted by: Jamal.