badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Reply To: TH: Horizontal/Vertical Post and TH: Card/Block Posts

#96702
M Srinivas
Participant

Thank you. Are you indicating that I can change sort order of TH: horizontal/vertical and TH: card/block by editing newscard-widgets.php?

In functions.php I am using this code to change the sort order of posts. I need to change the sort order of the display of the TH blocks as well.

//ADDED THIS FUNCTION (LINES 27 TO 38) FOR CUSTOM SORTING BY TITLE NAME

function order_posts_by_title( $query ) { 

   if ( $query->is_home() && $query->is_main_query() ) { 

     $query-set( 'orderby', 'title' ); 

     $query-set( 'order', 'ASC' ); 

   } 

} 
add_action( 'pre_get_posts', 'order_posts_by_title' );