-
-
Save billerickson/07c8c4da232083345524 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
/** | |
* Portfolio Query | |
* | |
*/ | |
function be_portfolio_query( $query ) { | |
if( $query->is_main_query() && $query->is_post_type_archive('portfolio' ) && ! is_admin() ) { | |
$query->set( 'orderby', 'title'); | |
$query->set( 'order', 'ASC'); | |
} | |
} | |
add_action( 'pre_get_posts', 'be_portfolio_query' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment