• Is it possible have this conditional in rss feed:

    if there is text in the excerpt use only the excerpt, if not use only the content

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Marcomail

    (@marcomail)

    none ?

    Thread Starter Marcomail

    (@marcomail)

    help

    Thread Starter Marcomail

    (@marcomail)

    up

    If there is no text in the post, why would you want to use the_content? — There’s no content to insert!

    Thread Starter Marcomail

    (@marcomail)

    But i can do it ?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Sure, you could modify the feed to do that, but it seems pointless. If the_excerpt is empty, then the_content will be empty too.

    Thread Starter Marcomail

    (@marcomail)

    Could you give me the exact code, i’m not a programmer.

    i think this is the code to modify:

    <?php if (get_settings('rss_use_excerpt')) : ?>
    <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    <?php else : ?>
    <description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
    <?php if ( strlen( $post->post_content ) > 0 ) : ?>
    <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    <?php else : ?>
    <content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
    <?php endif; ?>
    <?php endif; ?>

    Thread Starter Marcomail

    (@marcomail)

    none ?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘rss feed (conditional tag)’ is closed to new replies.