質問編集履歴
1
CODE部分を修正しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,9 +7,10 @@
|
|
7
7
|
|
8
8
|
### ソースコード
|
9
9
|
|
10
|
+
```ここに言語を入力
|
10
11
|
<?php
|
11
12
|
global $post;
|
12
|
-
$term = array_shift(get_the_terms($post->ID, 'topics_category'));
|
13
|
+
$term = array_shift(get_the_terms($post->ID, 'topics_category'));
|
13
14
|
$args = array(
|
14
15
|
'numberposts' => 8, //8件表示(デフォルトは5件)
|
15
16
|
'post_type' => 'topics', //カスタム投稿タイプ名
|
@@ -25,4 +26,5 @@
|
|
25
26
|
<?php endforeach; ?>
|
26
27
|
<?php else : ?>
|
27
28
|
<p>関連アイテムはまだありません。</p>
|
28
|
-
<?php endif; wp_reset_postdata(); ?>
|
29
|
+
<?php endif; wp_reset_postdata(); ?>
|
30
|
+
```
|