エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
WordPress, Category ArchiveでもStickyさせたい
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
WordPress, Category ArchiveでもStickyさせたい
WordPressで投稿にSticky(先頭に表示)してもCategoryページだと反映されません。 で、次のようにして... WordPressで投稿にSticky(先頭に表示)してもCategoryページだと反映されません。 で、次のようにしてみました。 // sticky $args = array( 'posts_per_page' => 1, 'post__in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1 ); query_posts( $args ); while ( have_posts() ) : the_post(); get_template_part( 'content', get_post_format() ); endwhile; wp_reset_query(); // 残りの投稿 $wp_query->query_vars['post__not_in'] = get_option( 'sticky_posts