Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function set_posts_per_page_for_attorneys_cpt( $atty ) {
- if ( !is_admin() && $atty->is_main_query() && is_post_type_archive( 'attorneys' ) ) {
- $atty->set( 'posts_per_page', '-1' );
- $atty->set( 'meta_key', 'last_name' );
- $atty->set( 'orderby', 'meta_value' );
- $atty->set( 'order', 'ASC' );
- $atty->set( 'facetwp', true);
- }
- }
- add_action( 'pre_get_posts', 'set_posts_per_page_for_attorneys_cpt' );
Add Comment
Please, Sign In to add comment