Skip to content

Instantly share code, notes, and snippets.

@metrosuperstar
Forked from indikatordesign/functions.php
Created March 11, 2019 19:35
Show Gist options
  • Save metrosuperstar/f651c71f91ba1888945e84e57b5cf1d2 to your computer and use it in GitHub Desktop.
Save metrosuperstar/f651c71f91ba1888945e84e57b5cf1d2 to your computer and use it in GitHub Desktop.
[Divi - Change the order for the default filterable portfolio module]
<?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