Skip to content

Instantly share code, notes, and snippets.

@indikatordesign
Last active November 5, 2021 01:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save indikatordesign/069c0b7f363977e092bb5193bdf74133 to your computer and use it in GitHub Desktop.
Save indikatordesign/069c0b7f363977e092bb5193bdf74133 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
@tecnologiasos
Copy link

Thank you very much!!! This code is amazing, and save my life!!! I was thinking in remake an filterable portfolio with more than 600 entrees or change their dates one by one. The upgrade done by @benjaminlately works perfectly on my site. Thanks again from Caracas Venezuela.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment