- fixed posts query in the User Profile;

This commit is contained in:
Nikita Sinelnikov
2021-08-12 15:57:21 +03:00
parent 15ee898905
commit c8a09caef4
2 changed files with 13 additions and 11 deletions
+12 -10
View File
@@ -29,11 +29,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
*/
function add_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => 0,
'author' => um_get_requested_user(),
'post_status' => array( 'publish' )
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => 0,
'author' => um_get_requested_user(),
'post_status' => array( 'publish' ),
'um_main_query' => true,
);
/**
@@ -107,11 +108,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
$page = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 0;
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => ( $page - 1 ) * 10,
'author' => $author,
'post_status' => array( 'publish' )
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => ( $page - 1 ) * 10,
'author' => $author,
'post_status' => array( 'publish' ),
'um_main_query' => true,
);
/**