Edit File by line
/home/barbar84/www/wp-inclu...
File: feed-rss2.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* RSS2 Feed Template for displaying RSS2 Posts feed.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
header( 'Content-Type: ' . feed_content_type( 'rss2' ) . '; charset=' . get_option( 'blog_charset' ), true );
[7] Fix | Delete
$more = 1;
[8] Fix | Delete
[9] Fix | Delete
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Fires between the xml and rss tags in a feed.
[13] Fix | Delete
*
[14] Fix | Delete
* @since 4.0.0
[15] Fix | Delete
*
[16] Fix | Delete
* @param string $context Type of feed. Possible values include 'rss2', 'rss2-comments',
[17] Fix | Delete
* 'rdf', 'atom', and 'atom-comments'.
[18] Fix | Delete
*/
[19] Fix | Delete
do_action( 'rss_tag_pre', 'rss2' );
[20] Fix | Delete
?>
[21] Fix | Delete
<rss version="2.0"
[22] Fix | Delete
xmlns:content="http://purl.org/rss/1.0/modules/content/"
[23] Fix | Delete
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
[24] Fix | Delete
xmlns:dc="http://purl.org/dc/elements/1.1/"
[25] Fix | Delete
xmlns:atom="http://www.w3.org/2005/Atom"
[26] Fix | Delete
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
[27] Fix | Delete
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
[28] Fix | Delete
<?php
[29] Fix | Delete
/**
[30] Fix | Delete
* Fires at the end of the RSS root to add namespaces.
[31] Fix | Delete
*
[32] Fix | Delete
* @since 2.0.0
[33] Fix | Delete
*/
[34] Fix | Delete
do_action( 'rss2_ns' );
[35] Fix | Delete
?>
[36] Fix | Delete
>
[37] Fix | Delete
[38] Fix | Delete
<channel>
[39] Fix | Delete
<title><?php wp_title_rss(); ?></title>
[40] Fix | Delete
<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
[41] Fix | Delete
<link><?php bloginfo_rss( 'url' ); ?></link>
[42] Fix | Delete
<description><?php bloginfo_rss( 'description' ); ?></description>
[43] Fix | Delete
<lastBuildDate><?php echo get_feed_build_date( 'r' ); ?></lastBuildDate>
[44] Fix | Delete
<language><?php bloginfo_rss( 'language' ); ?></language>
[45] Fix | Delete
<sy:updatePeriod>
[46] Fix | Delete
<?php
[47] Fix | Delete
$duration = 'hourly';
[48] Fix | Delete
[49] Fix | Delete
/**
[50] Fix | Delete
* Filters how often to update the RSS feed.
[51] Fix | Delete
*
[52] Fix | Delete
* @since 2.1.0
[53] Fix | Delete
*
[54] Fix | Delete
* @param string $duration The update period. Accepts 'hourly', 'daily', 'weekly', 'monthly',
[55] Fix | Delete
* 'yearly'. Default 'hourly'.
[56] Fix | Delete
*/
[57] Fix | Delete
echo apply_filters( 'rss_update_period', $duration );
[58] Fix | Delete
?>
[59] Fix | Delete
</sy:updatePeriod>
[60] Fix | Delete
<sy:updateFrequency>
[61] Fix | Delete
<?php
[62] Fix | Delete
$frequency = '1';
[63] Fix | Delete
[64] Fix | Delete
/**
[65] Fix | Delete
* Filters the RSS update frequency.
[66] Fix | Delete
*
[67] Fix | Delete
* @since 2.1.0
[68] Fix | Delete
*
[69] Fix | Delete
* @param string $frequency An integer passed as a string representing the frequency
[70] Fix | Delete
* of RSS updates within the update period. Default '1'.
[71] Fix | Delete
*/
[72] Fix | Delete
echo apply_filters( 'rss_update_frequency', $frequency );
[73] Fix | Delete
?>
[74] Fix | Delete
</sy:updateFrequency>
[75] Fix | Delete
<?php
[76] Fix | Delete
/**
[77] Fix | Delete
* Fires at the end of the RSS2 Feed Header.
[78] Fix | Delete
*
[79] Fix | Delete
* @since 2.0.0
[80] Fix | Delete
*/
[81] Fix | Delete
do_action( 'rss2_head' );
[82] Fix | Delete
[83] Fix | Delete
while ( have_posts() ) :
[84] Fix | Delete
the_post();
[85] Fix | Delete
?>
[86] Fix | Delete
<item>
[87] Fix | Delete
<title><?php the_title_rss(); ?></title>
[88] Fix | Delete
<link><?php the_permalink_rss(); ?></link>
[89] Fix | Delete
<?php if ( get_comments_number() || comments_open() ) : ?>
[90] Fix | Delete
<comments><?php comments_link_feed(); ?></comments>
[91] Fix | Delete
<?php endif; ?>
[92] Fix | Delete
[93] Fix | Delete
<dc:creator><![CDATA[<?php the_author(); ?>]]></dc:creator>
[94] Fix | Delete
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
[95] Fix | Delete
<?php the_category_rss( 'rss2' ); ?>
[96] Fix | Delete
<guid isPermaLink="false"><?php the_guid(); ?></guid>
[97] Fix | Delete
[98] Fix | Delete
<?php if ( get_option( 'rss_use_excerpt' ) ) : ?>
[99] Fix | Delete
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
[100] Fix | Delete
<?php else : ?>
[101] Fix | Delete
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
[102] Fix | Delete
<?php $content = get_the_content_feed( 'rss2' ); ?>
[103] Fix | Delete
<?php if ( strlen( $content ) > 0 ) : ?>
[104] Fix | Delete
<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
[105] Fix | Delete
<?php else : ?>
[106] Fix | Delete
<content:encoded><![CDATA[<?php the_excerpt_rss(); ?>]]></content:encoded>
[107] Fix | Delete
<?php endif; ?>
[108] Fix | Delete
<?php endif; ?>
[109] Fix | Delete
[110] Fix | Delete
<?php if ( get_comments_number() || comments_open() ) : ?>
[111] Fix | Delete
<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link( null, 'rss2' ) ); ?></wfw:commentRss>
[112] Fix | Delete
<slash:comments><?php echo get_comments_number(); ?></slash:comments>
[113] Fix | Delete
<?php endif; ?>
[114] Fix | Delete
[115] Fix | Delete
<?php rss_enclosure(); ?>
[116] Fix | Delete
[117] Fix | Delete
<?php
[118] Fix | Delete
/**
[119] Fix | Delete
* Fires at the end of each RSS2 feed item.
[120] Fix | Delete
*
[121] Fix | Delete
* @since 2.0.0
[122] Fix | Delete
*/
[123] Fix | Delete
do_action( 'rss2_item' );
[124] Fix | Delete
?>
[125] Fix | Delete
</item>
[126] Fix | Delete
<?php endwhile; ?>
[127] Fix | Delete
</channel>
[128] Fix | Delete
</rss>
[129] Fix | Delete
[130] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function