hi tom
i am getting an error on all pages after updating to latest version of php 7.3.9
the error is pasted below.
Warning: Use of undefined constant is_tag – assumed ‘is_tag’ (this will throw an Error in a future version of PHP) in /home/vegrecip/public_html/wp-content/themes/generatepress_child/functions.php on line 136
the above error points to a certain code. after removing the code the error goes away. code is pasted below. what needs to be changed in this code so that the error is not there.
/*posts in categories*/
function wpex_order_category( $query ) {
// exit out if it’s the admin or it isn’t the main query
if ( is_admin() || ! $query->is_main_query() || $query->is_search || $query->is_feed ) {
return;
}
// order category archives by title in ascending order
if ( is_category() || ( is_tag)) {
$query->set( ‘order’ , ‘dsc’ );
$query->set( ‘orderby’, ‘comment_count’);
return;
}
}
add_action( ‘pre_get_posts’, ‘wpex_order_category’, 1 );
regards
dassana