回答編集履歴

4

ページ送りが設置された様子の画像を提示

2015/03/04 08:56

投稿

nia_tn1012
nia_tn1012

スコア66

test CHANGED
@@ -67,3 +67,7 @@
67
67
  <?php get_footer(); ?>
68
68
 
69
69
  ```
70
+
71
+
72
+
73
+ ![ページ送りの設定の様子][WIDTH:600](e4f8c775fedf344eb8c56d9907f0d0e9.jpeg)

3

訂正

2015/03/04 08:56

投稿

nia_tn1012
nia_tn1012

スコア66

test CHANGED
@@ -1,21 +1,69 @@
1
- index.phpにある記事一覧を表示する処理
1
+ トップページを表示するテンプレート(index.phpにある記事一覧を表示する処理の後に
2
+
3
+ 「**<?php wp_pagenavi(); ?>**」を入れます。
2
4
 
3
5
  ```lang-php
4
6
 
5
- <?php while ( have_posts() ) : the_post(); ?>
7
+ <?php get_header(); ?>
6
8
 
7
- <?php get_template_part( 'content', get_post_format() ); ?>
8
9
 
10
+
11
+ <div id="primary" class="site-content">
12
+
13
+
14
+
15
+ <div id="content" role="main">
16
+
17
+
18
+
19
+ <?php if ( have_posts() ) : ?>
20
+
21
+
22
+
23
+
24
+
25
+ <?php/* --- 記事一覧の表示の処理 --- */ ?>
26
+
27
+ <?php /* Start the Loop */ ?>
28
+
29
+ <?php while ( have_posts() ) : the_post(); ?>
30
+
31
+ <?php get_template_part( 'content', get_post_format() ); ?>
32
+
9
- <?php endwhile; ?>
33
+ <?php endwhile; ?>
34
+
35
+
36
+
37
+ <?php/* --- ここにページ送りを設置するコードを入れます。 --- */ ?>
38
+
39
+ <?php wp_pagenavi(); ?>
40
+
41
+
42
+
43
+
44
+
45
+ <?php else : ?>
46
+
47
+
48
+
49
+ <?php/* 中略(※この部分は記事が何もなかった場合の時の処理です) */ ?>
50
+
51
+
52
+
53
+ <?php endif; // end have_posts() check ?>
54
+
55
+
56
+
57
+ </div><!-- #content -->
58
+
59
+
60
+
61
+ </div><!-- #primary -->
62
+
63
+
64
+
65
+ <?php get_sidebar(); ?>
66
+
67
+ <?php get_footer(); ?>
10
68
 
11
69
  ```
12
-
13
- の前(記事一覧の前に設置する場合)もしくは後(記事一覧の後に設定する場合)に
14
-
15
- ```lang-php
16
-
17
- <?php wp_pagenavi(); ?>
18
-
19
- ```
20
-
21
- を入れます。

2

実際のindex.phpを例に、設置するコードを提示

2015/03/04 08:48

投稿

nia_tn1012
nia_tn1012

スコア66

test CHANGED
@@ -1,77 +1,21 @@
1
- トップページを表示するテンプレート(index.phpにある記事一覧表示処理の後に
1
+ index.phpにある記事一覧表示する処理
2
-
3
- 「**<?php wp_pagenavi(); ?>**」を入れます。
4
-
5
-
6
2
 
7
3
  ```lang-php
8
4
 
9
- <?php get_header(); ?>
5
+ <?php while ( have_posts() ) : the_post(); ?>
10
6
 
7
+ <?php get_template_part( 'content', get_post_format() ); ?>
11
8
 
12
-
13
- <div id="primary" class="site-content">
14
-
15
-
16
-
17
- <div id="content" role="main">
18
-
19
-
20
-
21
- <?php if ( have_posts() ) : ?>
22
-
23
-
24
-
25
-
26
-
27
- <?php/* --- 記事一覧の表示の処理 --- */ ?>
28
-
29
- <?php /* Start the Loop */ ?>
30
-
31
- <?php while ( have_posts() ) : the_post(); ?>
32
-
33
- <?php get_template_part( 'content', get_post_format() ); ?>
34
-
35
- <?php endwhile; ?>
9
+ <?php endwhile; ?>
36
-
37
-
38
-
39
- <?php/* --- ここにページ送りを設置するコードを入れます。 --- */ ?>
40
-
41
- <?php wp_pagenavi(); ?>
42
-
43
-
44
-
45
-
46
-
47
- <?php else : ?>
48
-
49
-
50
-
51
- <?php/* 中略(※この部分は記事が何もなかった場合の時の処理です) */ ?>
52
-
53
-
54
-
55
- <?php endif; // end have_posts() check ?>
56
-
57
-
58
-
59
- </div><!-- #content -->
60
-
61
-
62
-
63
- </div><!-- #primary -->
64
-
65
-
66
-
67
- <?php get_sidebar(); ?>
68
-
69
- <?php get_footer(); ?>
70
10
 
71
11
  ```
72
12
 
13
+ の前(記事一覧の前に設置する場合)もしくは後(記事一覧の後に設定する場合)に
73
14
 
15
+ ```lang-php
74
16
 
17
+ <?php wp_pagenavi(); ?>
75
18
 
19
+ ```
76
20
 
77
-
21
+ を入れます。

1

実際のindex.phpを例に、設置するコードを提示

2015/03/04 08:46

投稿

nia_tn1012
nia_tn1012

スコア66

test CHANGED
@@ -1,21 +1,77 @@
1
- index.phpにある記事一覧表示する処理
1
+ トップページを表示するテンプレート(index.phpにある記事一覧表示処理の後に
2
+
3
+ 「**<?php wp_pagenavi(); ?>**」を入れます。
4
+
5
+
2
6
 
3
7
  ```lang-php
4
8
 
5
- <?php while ( have_posts() ) : the_post(); ?>
9
+ <?php get_header(); ?>
6
10
 
7
- <?php get_template_part( 'content', get_post_format() ); ?>
8
11
 
12
+
13
+ <div id="primary" class="site-content">
14
+
15
+
16
+
17
+ <div id="content" role="main">
18
+
19
+
20
+
21
+ <?php if ( have_posts() ) : ?>
22
+
23
+
24
+
25
+
26
+
27
+ <?php/* --- 記事一覧の表示の処理 --- */ ?>
28
+
29
+ <?php /* Start the Loop */ ?>
30
+
31
+ <?php while ( have_posts() ) : the_post(); ?>
32
+
33
+ <?php get_template_part( 'content', get_post_format() ); ?>
34
+
9
- <?php endwhile; ?>
35
+ <?php endwhile; ?>
36
+
37
+
38
+
39
+ <?php/* --- ここにページ送りを設置するコードを入れます。 --- */ ?>
40
+
41
+ <?php wp_pagenavi(); ?>
42
+
43
+
44
+
45
+
46
+
47
+ <?php else : ?>
48
+
49
+
50
+
51
+ <?php/* 中略(※この部分は記事が何もなかった場合の時の処理です) */ ?>
52
+
53
+
54
+
55
+ <?php endif; // end have_posts() check ?>
56
+
57
+
58
+
59
+ </div><!-- #content -->
60
+
61
+
62
+
63
+ </div><!-- #primary -->
64
+
65
+
66
+
67
+ <?php get_sidebar(); ?>
68
+
69
+ <?php get_footer(); ?>
10
70
 
11
71
  ```
12
72
 
13
- の前(記事一覧の前に設置する場合)もしくは後(記事一覧の後に設定する場合)に
14
73
 
15
- ```lang-php
16
74
 
17
- <?php wp_pagenavi(); ?>
18
75
 
19
- ```
20
76
 
21
- を入れます。
77
+