2017-12-15 5 views

答えて

0

あなたはこれらの記事をフィルタリングするためにWP_Queryを使用することができます含めるようにしたくない、私は

$sticky = count(get_option('sticky_posts')); 

でスティッキーポストの数を取得することができますが、それは計画の記事を含んでいます。

$args = [ 
     'post__in' => get_option('sticky_posts'), 
     'post_status' => 'publish' 
]; 

$posts = new WP_Query($args); 

var_dump($posts->posts); 
+0

次に、$ sticky_count = $ posts-> post_countです。それは動作します、ありがとう – Vald

関連する問題