質問編集履歴

2

質問内容の変更

2021/06/04 14:59

投稿

code_mate
code_mate

スコア4

test CHANGED
File without changes
test CHANGED
@@ -44,15 +44,149 @@
44
44
 
45
45
 
46
46
 
47
- あと、テーマファイルをみも、
47
+ 「ブログ一覧」が出力されいる
48
48
 
49
- この「ブログ一覧」に該当する
49
+ home.php
50
50
 
51
+
52
+
53
+ ```PHP
54
+
51
- PHPファイルが見当たりません。
55
+ <?php get_header(); ?>
56
+
57
+ <div class="header-box"></div>
58
+
59
+ <div class="container">
60
+
61
+ <div class="contents">
62
+
63
+ <?php if(have_posts()): while(have_posts()): the_post(); ?>
64
+
65
+ <?php get_template_part('loop-content'); ?>
66
+
67
+ <?php endwhile; endif; ?><!--ループ終了-->
52
68
 
53
69
 
54
70
 
71
+ <div class="pagination">
72
+
73
+ <?php echo paginate_links( array(
74
+
75
+ 'type' => 'list',
76
+
77
+ 'mid_size' => '1',
78
+
79
+ 'prev_text' => '<i class="fas fa-angle-left"></i>',
80
+
81
+ 'next_text' => '<i class="fas fa-angle-right"></i>'
82
+
83
+ ) ); ?>
84
+
85
+ </div>
86
+
87
+
88
+
89
+
90
+
91
+ </div><!--end contents-->
92
+
93
+ <?php get_sidebar(); ?>
94
+
95
+ </div><!--end container-->
96
+
97
+ <?php get_footer(); ?>
98
+
99
+ ```
100
+
101
+
102
+
103
+ loop-content.php
104
+
105
+
106
+
107
+ ```PHP
108
+
109
+ <article <?php post_class( 'article-list' ); ?>>
110
+
111
+ <a href="<?php the_permalink(); ?>">
112
+
113
+ <div class="img-wrap">
114
+
115
+ <!--画像を追加-->
116
+
117
+ <?php if( has_post_thumbnail() ): ?>
118
+
119
+ <?php the_post_thumbnail('medium'); ?>
120
+
121
+ <?php else: ?>
122
+
123
+ <img src="<?php echo get_template_directory_uri(); ?>/images/no-image.gif" alt="no-img"/>
124
+
125
+ <?php endif; ?>
126
+
127
+ <!--カテゴリ-->
128
+
129
+ <?php if (!is_category() && has_category()): ?>
130
+
131
+ <span class="cat-data">
132
+
133
+ <?php
134
+
135
+ $postcat = get_the_category();
136
+
137
+ echo $postcat[0]->name;
138
+
139
+ ?>
140
+
141
+ </span>
142
+
143
+ <?php endif; ?>
144
+
145
+ </div><!--end img-warp-->
146
+
55
- 「ブログ一覧」は、どこにファイルがあるのかわかるかた教えてください。
147
+ <div class="text">
148
+
149
+ <!--タイトル-->
150
+
151
+ <h2><?php the_title(); ?></h2>
152
+
153
+
154
+
155
+ <!--投稿日を表示-->
156
+
157
+ <span class="article-date">
158
+
159
+ <!-- <i class="far fa-clock"></i> -->
160
+
161
+ <time datetime="<?php echo get_the_date( 'Y-m-d' ); ?>">
162
+
163
+ <?php echo get_the_date(); ?>
164
+
165
+ </time>
166
+
167
+ </span>
168
+
169
+ <!--著者を表示-->
170
+
171
+ <!-- <span class="article-author">
172
+
173
+ <i class="fas fa-user"></i><?php the_author(); ?>
174
+
175
+ </span> -->
176
+
177
+ <!--抜粋-->
178
+
179
+ <?php the_excerpt(); ?>
180
+
181
+ </div><!--end text-->
182
+
183
+ </a>
184
+
185
+ </article>
186
+
187
+
188
+
189
+ ```
56
190
 
57
191
 
58
192
 

1

質問修正

2021/06/04 14:59

投稿

code_mate
code_mate

スコア4

test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,9 @@
8
8
 
9
9
 
10
10
 
11
- Wordpressで、個別ページに「ブログ一覧」というページを作成し、
11
+ Wordpressで、個別ページに「ブログ一覧」
12
+
13
+ 「https://sample1.veronica9.com/blog/」というページを作成し、
12
14
 
13
15
  投稿一覧を表示させたく、下記の設定を行いました。
14
16
 
@@ -36,72 +38,22 @@
36
38
 
37
39
 
38
40
 
39
- page-blog.php
41
+ CSSで消す以外で、解決法がお分かりになる方いらっしゃいましたら、
40
42
 
41
-
43
+ ご教授お願い致します。
42
44
 
43
45
 
44
46
 
45
- ```php
47
+ あと、テーマファイルをみても、
46
48
 
47
- <?php /*
49
+ この「ブログ一覧」に該当する
48
50
 
49
- Template Name: ブログ
50
-
51
- */ ?>
52
-
53
- <?php get_header(); ?>
54
-
55
- // 略
56
-
57
- <?php query_posts('post_type=post&paged='.$paged); ?>
58
-
59
- <?php if (have_posts()) : ?>
60
-
61
- <?php while (have_posts()) : the_post(); ?>
62
-
63
- <div class="post">
64
-
65
- <p><?php the_time("Y年m月j日") ?></p>
66
-
67
- <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
68
-
69
- <?php if(has_post_thumbnail()) { the_post_thumbnail(); } ?>
70
-
71
- <?php global $more; $more = FALSE; ?>
72
-
73
- <?php the_content('続きを読む'); ?>
74
-
75
- <?php $more = TRUE; ?>
76
-
77
- </div>
51
+ PHPファイルが見当たりません。
78
-
79
- <?php endwhile; ?>
80
-
81
- <?php else : ?>
82
-
83
- <div class="post">
84
-
85
- <h2>記事が見つかりません</h2>
86
-
87
- <p>記事が存在しないときのテキスト</p>
88
-
89
- </div>
90
-
91
- <?php endif; ?>
92
-
93
- <?php wp_reset_query(); ?>
94
-
95
- // 略
96
-
97
- <?php get_sidebar(); ?>
98
-
99
- <?php get_footer(); ?>
100
-
101
- ```
102
52
 
103
53
 
104
54
 
105
- CSSで消す以外で解決法お分りにならっしゃいましたら、
55
+ 「ブログ一覧」はどこにファイルあるのわかかた教えてくださ
106
56
 
57
+
58
+
107
- ご教授お願い致します。
59
+ どうぞよろしくお願い致します。