-
-
Save metrosuperstar/f651c71f91ba1888945e84e57b5cf1d2 to your computer and use it in GitHub Desktop.
[Divi - Change the order for the default filterable portfolio module]
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 | |
// Add this snippet to your themes "functions.php" to order the projects by title | |
add_action( 'parse_query', function( $vars ) | |
{ | |
if ( 'project' == $vars->query['post_type'] ) | |
{ | |
$vars->set( 'orderby', 'title' ); | |
$vars->set( 'order', 'ASC' ); // DESC | |
} // end if | |
}); // end add_action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment