Created
September 20, 2023 04:06
-
-
Save bibicadotnet/f4489592b4560b7e38634e3bef10ad13 to your computer and use it in GitHub Desktop.
Hiển trị cập nhập mới nhất ngoài trang chủ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Plugin Name: Hiển trị bài viết | |
Description: Hiển trị cập nhập mới nhất ngoài trang chủ | |
*/ | |
function cswp_update_posts( $query ) { | |
if ($query->is_main_query()) { | |
$query->set( 'orderby', 'modified' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'cswp_update_posts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment