这会检索帖子,但不会限制返回的帖子数量。我如何限制它?
// Query Args
$args = array(
'post_status' => 'published',
'posts_per_page' => '5',
'category_name' => 'payment',
'meta_query' => array(
'key' => 'payment_club',
'value' => $current_user->user_login,
)
);
答案 0 :(得分:1)
试试这个:
$args = array(
'post_status' => 'published',
'posts_per_page' => 5,
'category_name' => 'payment',
'meta_query' => array( array(
'key' => 'payment_club',
'value' => $current_user->user_login
)
)
);
我认为posts_per_page必须是整数