Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22977

    Hi! Enfold is amazing.

    Need help: I want to be able to sort my Portfolio items on a page not only with ID:s but with Dates or preferably Random.

    #118106

    Add following code to the bottom of functions.php:

    function custom_post_grid_query( $query, $params ) {
    $query['orderby'] = 'date';
    $query['order'] = 'DESC';
    return $query;
    }
    add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);

    For an ascending order use ASC instead of DESC.. For a random order use:

    function custom_post_grid_query( $query, $params ) {
    $query['orderby'] = 'rand';
    return $query;
    }
    add_filter( 'avia_post_grid_query', 'custom_post_grid_query', 10, 2);

    #118107

    Dude, i Just put on functions.php (enfold theme folder)

    function custom_post_grid_query( $query, $params ) {

    $query = ‘date’;

    $query = ‘DESC’;

    return $query;

    }

    add_filter( ‘avia_post_grid_query’, ‘custom_post_grid_query’, 10, 2);

    But it’s not showing the last portfolio on home page, you can see on:

    http://www.ecomanda.com.br

    The portfolio page is: (see that there is 3 newer itens)

    http://www.ecomanda.com.br/padarias-bares-restaurantes/

    #118108

    Hi,

    Please edit your homepage, look for Portfolio Grid. Edit it then find Post Number, select the number of items that should be displayed.

    Regards,

    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Sorting portfolio items’ is closed to new replies.