回答編集履歴

1

ソースコード追記

2017/01/22 04:24

投稿

退会済みユーザー
test CHANGED
@@ -3,3 +3,39 @@
3
3
 
4
4
 
5
5
  はい、`is_single()`を使用するといいと思います。
6
+
7
+ ###追記
8
+
9
+ Twenty Twelveの`single.php`と`page.php`を変更していないと仮定して。
10
+
11
+ ####content.php
12
+
13
+ ```PHP
14
+
15
+ <?php if ( is_single() ) : ?>
16
+
17
+ <!-- これは個別投稿用 -->
18
+
19
+ <!-- いらん -->
20
+
21
+ <?php else : ?>
22
+
23
+ <h1 class="entry-title">
24
+
25
+ <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
26
+
27
+ </h1>
28
+
29
+ <?php endif; // is_single() ?>
30
+
31
+ ```
32
+
33
+ ####content-page.php
34
+
35
+ ```PHP
36
+
37
+ <!-- これは固定ページ用 -->
38
+
39
+ <h1 class="entry-title entry-title-page"><?php the_title(); ?></h1>
40
+
41
+ ```