回答編集履歴
1
質問者のコメントを受けて、コード例を追記
test
CHANGED
@@ -11,3 +11,77 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
[https://www.kopjapan.com/blog/web/wordpress%E3%81%A7%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E6%8A%95%E7%A8%BF%E3%81%AE%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%96%E3%81%A7%E3%81%AE%E8%A1%A8%E7%A4%BA%E4%BB%B6%E6%95%B0%E3%82%92%E6%8C%87](https://www.kopjapan.com/blog/web/wordpress%E3%81%A7%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%A0%E6%8A%95%E7%A8%BF%E3%81%AE%E3%82%A2%E3%83%BC%E3%82%AB%E3%82%A4%E3%83%96%E3%81%A7%E3%81%AE%E8%A1%A8%E7%A4%BA%E4%BB%B6%E6%95%B0%E3%82%92%E6%8C%87)
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
---
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
追記(質問者さんのコメントを受けて)
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
archive-news.php実装例。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```PHP
|
30
|
+
|
31
|
+
<?php get_header();
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
if ( have_posts() ) {
|
36
|
+
|
37
|
+
while ( have_posts() ) {
|
38
|
+
|
39
|
+
the_post();
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
the_title();
|
44
|
+
|
45
|
+
the_content();
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
} // end while
|
50
|
+
|
51
|
+
} // end if
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
if ($wp_query->max_num_pages > 1) {
|
56
|
+
|
57
|
+
echo '<div class="pagination">';
|
58
|
+
|
59
|
+
echo paginate_links( array(
|
60
|
+
|
61
|
+
'base' => get_pagenum_link(1).'%_%',
|
62
|
+
|
63
|
+
'format' => '/page/%#%/',
|
64
|
+
|
65
|
+
'current' => max(1, $paged),
|
66
|
+
|
67
|
+
'total' => $wp_query->max_num_pages,
|
68
|
+
|
69
|
+
'type' => 'list',
|
70
|
+
|
71
|
+
'mid_size' => '1',
|
72
|
+
|
73
|
+
'prev_text' => '<',
|
74
|
+
|
75
|
+
'next_text' => '>'
|
76
|
+
|
77
|
+
) );
|
78
|
+
|
79
|
+
echo '</div>';
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
get_footer();
|
86
|
+
|
87
|
+
```
|