質問編集履歴
1
クリックした際のURLと表示されるコード
test
CHANGED
File without changes
|
test
CHANGED
@@ -37,3 +37,199 @@
|
|
37
37
|
|
38
38
|
|
39
39
|
何卒ご教授お願いいたします。
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
englishはカスタム投稿名
|
44
|
+
|
45
|
+
english_catはタクソノミー
|
46
|
+
|
47
|
+
zyodousiはターム名
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
カテゴリーをクリックした際のURLはこちらです。
|
52
|
+
|
53
|
+
![イメージ説明](3d2b1774923ba6ac69293b3216048ec7.png)
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```ここに言語を入力
|
58
|
+
|
59
|
+
<?php
|
60
|
+
|
61
|
+
/*
|
62
|
+
|
63
|
+
カスタム投稿記事一覧ページのテンプレート
|
64
|
+
|
65
|
+
*/
|
66
|
+
|
67
|
+
?>
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<?php get_header(); ?>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<main role="main">
|
76
|
+
|
77
|
+
<!-- page_content -->
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<section class="page_content">
|
82
|
+
|
83
|
+
<div class="topic_path">
|
84
|
+
|
85
|
+
<?php if(function_exists('bcn_display')): //プラグインがあるか確認 ?>
|
86
|
+
|
87
|
+
<?php bcn_display(); ?>
|
88
|
+
|
89
|
+
<?php endif; ?>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div class="page_content__header">
|
94
|
+
|
95
|
+
<div class="page_content__header__title">
|
96
|
+
|
97
|
+
<h2>英語カテゴリー</h2>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<section class="page_content__body">
|
104
|
+
|
105
|
+
<div class="page_section clear_fix">
|
106
|
+
|
107
|
+
<div class="page_section__content">
|
108
|
+
|
109
|
+
<?php $posts = get_posts(array(
|
110
|
+
|
111
|
+
'post_type'=>'english', //カスタム投稿タイプ
|
112
|
+
|
113
|
+
'posts_per_page'=>'6', //表示件数s
|
114
|
+
|
115
|
+
)); ?>
|
116
|
+
|
117
|
+
<?php if (!empty($posts)): ?>
|
118
|
+
|
119
|
+
<?php foreach ($posts as $post): ?>
|
120
|
+
|
121
|
+
<?php setup_postdata($post); ?>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<article class="post">
|
126
|
+
|
127
|
+
<div class="post__inner">
|
128
|
+
|
129
|
+
<div class="post__meta">
|
130
|
+
|
131
|
+
<ul class="category">
|
132
|
+
|
133
|
+
<?php $terms = get_the_terms($post->ID, 'english_cat'); foreach ($terms as $term) : ?>
|
134
|
+
|
135
|
+
<a href="#" class="<?php echo $term->slug; ?>"><?php echo $term->name; ?></a>
|
136
|
+
|
137
|
+
</a>
|
138
|
+
|
139
|
+
<?php endforeach; ?>
|
140
|
+
|
141
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<time><?php the_time('Y年m月d日'); ?></time>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="post__catch">
|
150
|
+
|
151
|
+
<figure>
|
152
|
+
|
153
|
+
<?php if( has_post_thumbnail() ): ?>
|
154
|
+
|
155
|
+
<?php the_post_thumbnail(); ?>
|
156
|
+
|
157
|
+
<?php endif; ?>
|
158
|
+
|
159
|
+
</figure>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div class="post__content">
|
164
|
+
|
165
|
+
<h3><?php the_title(); ?></h3>
|
166
|
+
|
167
|
+
<?php the_content(); ?>
|
168
|
+
|
169
|
+
<div class="btn btn--c01"><a href="<?php the_permalink(); ?>">MORE></a></div>
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
</div>
|
174
|
+
|
175
|
+
</article>
|
176
|
+
|
177
|
+
<!-- //post -->
|
178
|
+
|
179
|
+
<?php endforeach; ?>
|
180
|
+
|
181
|
+
<?php wp_reset_postdata(); //必ず必要?>
|
182
|
+
|
183
|
+
<?php endif; ?>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
<div class="wp-pagenavi">
|
190
|
+
|
191
|
+
<?php if(function_exists('wp_pagenavi')): ?>
|
192
|
+
|
193
|
+
<?php wp_pagenavi(); ?>
|
194
|
+
|
195
|
+
<?php endif; ?>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<!-- //wp-pagenavi -->
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div class="page_section__side">
|
204
|
+
|
205
|
+
<?php get_search_form(); ?>
|
206
|
+
|
207
|
+
<?php if(is_post_type_archive()): ?>
|
208
|
+
|
209
|
+
<?php dynamic_sidebar( 'english_sidebar' ); ?>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<?php endif; ?>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
</section>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</section>
|
226
|
+
|
227
|
+
<!-- /top content -->
|
228
|
+
|
229
|
+
</main>
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<?php get_footer(); ?>
|
234
|
+
|
235
|
+
```
|