質問するログイン新規登録

質問編集履歴

1

添付するコードを誤っていた

2021/10/11 10:15

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -22,32 +22,7 @@
22
22
  ページネーションのコード
23
23
  ※post_typeの値はテンプレートファイルによって変わります
24
24
  ```
25
- <!-- ページネーション -->
26
- <div id="paginations" class="paginations">
27
- <?php
28
- $args = array(
29
- 'posts_per_page' => 6,
30
- 'paged' => $paged,
31
- 'orderby' => 'post_date',
32
- 'order' => 'DESC',
33
- 'post_type' => 'business-voice',
34
- 'post_status' => 'publish'
35
- );
36
- $the_query = new WP_Query($args);
37
-
38
- if ($the_query->max_num_pages > 1) {
39
- echo paginate_links(array(
40
- 'base' => get_pagenum_link(1) . '%_%',
41
- 'format' => 'page/%#%/',
25
+ <?php the_post_navigation( array( 'prev_text' => '前の記事を読む', 'next_text' => '次の記事を読む' ) ); ?>
42
- 'current' => max(1, $paged),
43
- 'total' => $the_query->max_num_pages,
44
- 'prev_text' => '< 前へ',
45
- 'next_text' => '次へ >',
46
- ));
47
- }
48
- ?>
49
- </div>
50
- <!-- ページネーション -->
51
26
  コード
52
27
  ```
53
28