Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23955

    Wondering if it’s possible to have the tiles on our main artists page show up randomly, or if it has to be alpha by first name? Curious on our options for randomly displaying our artists in the portfolio.

    http://wrvstudiotour.org/portfolio-4-columns/

    #121750

    Hi,

    Please place this code at the bottom of your functions.php

    function loop_portfolio_query( $location )
    {
    if ( $location == 'loop-portfolio' )
    {
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "rand";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );

    Remove browser cache then reload the page.

    Regards,

    Ismael

    #121751

    I have added this to the bottom of the functions.php file within the choices theme. I cleared my browsers caches and history with no luck on the update.

    http://wrvstudiotour.org/portfolio-4-columns/

    Any thoughts?

    #121752

    Strange – it should work. Please try a different sort parameter like:

    function loop_portfolio_query( $location )
    {
    if ( $location == 'loop-portfolio' )
    {
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "title";
    $avia_config['new_query']['order'] = "ASC";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );

    or

    function loop_portfolio_query( $location )
    {
    if ( $location == 'loop-portfolio' )
    {
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "title";
    $avia_config['new_query']['order'] = "DESC";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );

    or:

    function loop_portfolio_query( $location )
    {
    if ( $location == 'loop-portfolio' )
    {
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "date";
    $avia_config['new_query']['order'] = "ASC";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );

    Does any of these code snippets change the order? If not try to deactivate all third party plugins – maybe one hacks the query.

    #121753

    I also tried this solution but with no results.

    the website is iuxteam.com

    #121754

    Hi!

    Are you using the Choices theme?

    Best regards,

    Peter

    #121755

    It works perfectly with Coherence, thanks!

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Portfolio Random Display’ is closed to new replies.