Tagged: Latest Portfolio, reverse order, Widget
HI
I’d like to reverse the order of the portfolio items in the latest portfolio widget.
I found this thread: https://kriesi.at/support/topic/enfold-latest-portfolio-widget-order-reverse/ but I think the information is outdated as I couldn’t find the class-framework-widgets.php file. Can you help me with this?
thanks
Nancy
Hey Munford,
Thank you for the inquiry.
You’ll find the widget template in the widgets/widget-classes/class-avia-newsbox.php, and the query around line 163:
{
$new_query = array(
'posts_per_page' => $count,
'tax_query' => array(
array(
'taxonomy' => $this->avia_term,
'field' => 'id',
'terms' => explode( ',', $cat ),
'operator' => 'IN'
)
)
);
}
Best regards,
Ismael
thanks Ismael –
I found the code – what should I replace that with?
also can that be put in my child theme?
Hi,
Thank you for the update.
You can add the order and orderby parameters to the query.
{
$new_query = array(
'posts_per_page' => $count,
'orderby' => 'date',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => $this->avia_term,
'field' => 'id',
'terms' => explode( ',', $cat ),
'operator' => 'IN'
)
)
);
}
Unfortunately, it’s not possible to override the file in the child theme.
Best regards,
Ismael