WordPress

ある特定の条件下で記事を取得するときsticky_postを表示させない

            <?php 
            $sticky = get_option( 'sticky_posts' );
            $args = array(
                'post_type'=> 'post',
                'category_name' => 'news',
                'order'=> 'DESC',
                'posts_per_page' => 3,
                'ignore_sticky_posts' => 1,
                'post__not_in' => $sticky
            );
            query_posts( $args );
            ?>
Previous Post Next Post

You may also like

Leave a comment

Leave a Reply