teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

4

文脈の整頓

2018/10/12 07:06

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -10,7 +10,8 @@
10
10
  > <?php endif; ?>
11
11
  > <?php endif; ?>
12
12
 
13
+ の部分で抜粋等の条件判断して、振り分けています。
13
- の部分で抜粋等の条件判断して、振り分けていますので、本文は、`$post->post_content` に全文が入っているので、強制的に全部を表示するなら、条件判断を全てやめて、こんな感じに置き換えるとどうでしょうか?
14
+ 本文は、`$post->post_content` に全文が入っているので、強制的に全部を表示するなら、条件判断を全てやめて、こんな感じに置き換えるとどうでしょうか?
14
15
 
15
16
  ```PHP
16
17
  <?php global $post; ?>

3

追記・修正

2018/10/12 07:06

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -1,5 +1,16 @@
1
+ > <?php if (get_option('rss_use_excerpt')) : ?>
2
+ > <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
3
+ > <?php else : ?>
4
+ > <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
1
- 本文は、`$post->post_content` に全文が入っているので、強制的に全部を表示するなら、条件判断を全てやめて、こんな感じでどうでしょうか?
5
+ > <?php $content = get_the_content_feed('rss2'); ?>
6
+ > <?php if ( strlen( $content ) > 0 ) : ?>
7
+ > <content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
8
+ > <?php else : ?>
9
+ > <content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
10
+ > <?php endif; ?>
11
+ > <?php endif; ?>
2
12
 
13
+ の部分で抜粋等の条件判断して、振り分けていますので、本文は、`$post->post_content` に全文が入っているので、強制的に全部を表示するなら、条件判断を全てやめて、こんな感じに置き換えるとどうでしょうか?
3
14
 
4
15
  ```PHP
5
16
  <?php global $post; ?>

2

修正

2018/10/12 07:03

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
 
4
4
  ```PHP
5
- global $post;
5
+ <?php global $post; ?>
6
6
  <description><![CDATA[<?php echo $post->post_content; ?>]]></description>
7
7
  ```

1

修正

2018/10/12 05:15

投稿

CHERRY
CHERRY

スコア25234

answer CHANGED
@@ -1,7 +1,7 @@
1
1
  本文は、`$post->post_content` に全文が入っているので、強制的に全部を表示するなら、条件判断を全てやめて、こんな感じでどうでしょうか?
2
2
 
3
3
 
4
- ```
4
+ ```PHP
5
5
  global $post;
6
6
  <description><![CDATA[<?php echo $post->post_content; ?>]]></description>
7
7
  ```