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']['orderby'] = "ASC"; query_posts($avia_config['new_query']); } } } add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );