Last active
August 11, 2021 11:04
-
-
Save kmaroff/a0505c2d7419e208dcb8a3b744175357 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'pre_get_posts', 'custom_pagesize'); | |
| function custom_pagesize( $query ) { | |
| if( is_admin() || ! $query->is_main_query() ) | |
| return; | |
| if ( is_post_type_archive('portfolio_pods') ) { | |
| $query->set( 'posts_per_page', 9999 ); | |
| return; | |
| } | |
| if ( is_post_type_archive('news-pods') ) { | |
| $query->set( 'posts_per_page', 12 ); | |
| $query->set( 'orderby', 'ID' ); | |
| $query->set( 'order', 'DESC' ); | |
| return; | |
| } | |
| if ( taxonomy_exists('specialists_cat') ) { | |
| $query->set( 'posts_per_page', 9999 ); | |
| $query->set( 'orderby', 'ID' ); | |
| $query->set( 'order', 'ASC' ); | |
| return; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment