the_content_rss [ WordPress Function ]
| Parameters: |
|
| Uses: | |
| See: | |
| Defined at: |
|
Display the post content for the feed.
For encoding the html or the $encode_html parameter, there are three possible values. '0' will make urls footnotes and use make_url_footnote(). '1' will encode special characters and automatically display all of the content. The value of '2' will strip all HTML tags from the content.
Also note that you cannot set the amount of words and not set the html encoding. If that is the case, then the html encoding will default to 2, which will strip all HTML tags.
To restrict the amount of words of the content, you can use the cut parameter. If the content is less than the amount, then there won't be any dots added to the end. If there is content left over, then dots will be added and the rest of the content will be removed.
Source
<?php
function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
_deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' );
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content_rss', $content);
if ( $cut && !$encode_html )
$encode_html = 2;
if ( 1== $encode_html ) {
$content = esc_html($content);
$cut = 0;
} elseif ( 0 == $encode_html ) {
$content = make_url_footnote($content);
} elseif ( 2 == $encode_html ) {
$content = strip_tags($content);
}
if ( $cut ) {
$blah = explode(' ', $content);
if ( count($blah) > $cut ) {
$k = $cut;
$use_dotdotdot = 1;
} else {
$k = count($blah);
$use_dotdotdot = 0;
}
/** @todo Check performance, might be faster to use array slice instead. */
for ( $i=0; $i<$k; $i++ )
$excerpt .= $blah[$i].' ';
$excerpt .= ($use_dotdotdot) ? '...' : '';
$content = $excerpt;
}
$content = str_replace(']]>', ']]>', $content);
echo $content;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Template Tags/the content rss « WordPress Codex
This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions.
codex.wordpress.org - WordPress › Support » Tags — the_content_rss
the_content_rss is deprecated. ... the_content_rss() : only the length changes and nothing else, 1 ... the_content_rss not echoing anything, 4, voidtrance, 2 years ...
wordpress.org - WP the_content_rss replacement | ThemeForest Community Forums
I just watched a video where the_content_rss is used to display a certain number of words of a blog post before the post is cut off and the user ...
themeforest.net - the_content_rss Wordpress hook details -- Adam Brown, BYU ...
WordPress hook directory the_content_rss. Description. Applied to the post content prior to including in an RSS feed. This filter hasn't been functional since 2.7.
adambrown.info
Kullanýcý Tartýþmalarý [ wordpress.org ]
- shail1991 on "Allow links in posts displayed on homepage"
- shail1991 on "Allow links in posts displayed on homepage"
- Erfo on "the_content_rss is deprecated. Is there another code?"
- philbonsai on "Allow links in posts displayed on homepage"
- esmi on "Allow links in posts displayed on homepage"
- philbonsai on "Allow links in posts displayed on homepage"
- ch4sethe5un on "the_content_rss() : only the length changes and nothing else"
- voidtrance on "the_content_rss not echoing anything"
- voidtrance on "the_content_rss not echoing anything"
- Samuel B on "the_content_rss not echoing anything"