It was a limitation of the Wordpress Theme that I was using.
Wordpress get_posts not showing all the posts
-
17-01-2022 - |
質問
I am using the following code:
global $post;
$tmp_post = $post;
$staff = get_posts(array('numberposts' => -1, 'post_type'=> 'staff'));
$i = 0;
echo 'Staff number: '.count($staff);
and it echoes 'Staff number: 6' but if I run the following query
SELECT *
FROM `wp_posts`
WHERE `post_type` = 'staff'
LIMIT 0 , 30
it shows me the 7 members of the staff... any ideas on how to retrieve the 7 staff members by get_posts()?
Thank you
正しい解決策はありません
他のヒント
所属していません StackOverflow