Penci Design replied
Hi,
1/ I add custom code php to pennews/function.php file to Random posts for Archive pages and Mega Menu: http://prntscr.com/nchdes
function penci_wpsites_query( $query ) {
if ( $query->is_category() && $query->is_main_query() ) {
$query->set( 'orderby', 'rand' );
}
}
add_action( 'pre_get_posts', 'penci_wpsites_query' );2/ Random posts for Mega Menu. I add custom code penci-framwork plugin / mega-menu/menu-render.php line 160 http://prntscr.com/nchdmf
$attr = array(
'post_type' => $post_type,
'posts_per_page' => $numbers,
'ignore_sticky_posts' => 1,
'orderby' => 'rand',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => $tax,
'field' => 'id',
'terms' => $cat_id,
),
),
);
Note important: please backup the code before update PenNews theme with latest version.
Please check it again,
Best Regards,
PenciDesign