Title: Custom RSS Feed
Last modified: October 3, 2020

---

# Custom RSS Feed

 *  Resolved [mtjarrett](https://wordpress.org/support/users/mtjarrett/)
 * (@mtjarrett)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/custom-rss-feed-10/)
 * I’ve had a custom feed for years. For some reason it has started to throw errors
   this week. Please note that the whole reason I have it is because my website 
   puts out a podcast 3 times a day – Morning, Mid-day, and Evening. In order for
   people on the other side of the world to be able to have access to my podcast,
   I have to post a day in advance. But since most of my users are in the US and
   Canada, I have my RSS feed release the podcast a day late. So you will see in
   the code below that there is a function to delay the posting. It has been working
   fine.
 * But now my feed won’t even show up in order to validate it.
 *     ```
       <?php
       /**
        * RSS2 Feed Template for displaying RSS2 Posts feed.
        *
        * @package WordPress
        */
       header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
       $more = 1;
   
       echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
   
       <rss version="2.0"
       	xmlns:content="http://purl.org/rss/1.0/modules/content/"
       	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
       	xmlns:dc="http://purl.org/dc/elements/1.1/"
       	xmlns:atom="http://www.w3.org/2005/Atom"
       	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
       	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
       	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
       	xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
       	<?php do_action('rss2_ns'); ?>
       >
   
       <channel>
       	<title>Audio Daily Office @ The Trinity Mission</title>
       	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
       	<link><?php bloginfo_rss('url') ?></link>
       	<description>Following in the ancient way of Christian formation, join us each day for Prayer: Morning, Mid-Day, and Evening.</description>
       	<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
       	<language><?php bloginfo_rss( 'language' ); ?></language>
       	<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
       	<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
   
   
   
       	<itunes:summary>Following in the ancient way of Christian formation, join us each day for Prayer: Morning, Mid-Day, and Evening.</itunes:summary>
       	<itunes:author>The Trinity Mission</itunes:author>
       	<itunes:explicit>clean</itunes:explicit>
       	<itunes:image href="https://thetrinitymission.org/wp-content/uploads/powerpress/ITUNES-2020-3.png" />
       	<itunes:owner>
       	<itunes:name>The Trinity Mission</itunes:name>
       	<itunes:email>mtjarrett@michaeljarrett.com</itunes:email>
       	</itunes:owner>
       	<managingEditor>mtjarrett@michaeljarrett.com (The Trinity Mission)</managingEditor>
       	<copyright>Copyright © The Trinity Mission 2012-2020</copyright>
       	<itunes:subtitle>Morning, Mid-Day, & Evening Prayer</itunes:subtitle>
   
       	<image>
       	<title>Audio Daily Office | The Trinity Mission</title>
       	<url>https://thetrinitymission.org/wp-content/uploads/powerpress/ITUNES-2020-3.png</url>
       	<link>https://thetrinitymission.org</link>
       	</image>
       	<itunes:category text="Religion & Spirituality">
       	<itunes:category text="Christianity" />
       	</itunes:category>
       	<rawvoice:rating>TV-G</rawvoice:rating>
       	<rawvoice:location>Texas</rawvoice:location>
       	<rawvoice:frequency>Daily</rawvoice:frequency>
   
       	<?php 
       	date_default_timezone_set("America/Chicago");
       	$now_time = time();
       	while( have_posts()) : the_post();
       		if (get_active_post_time(get_the_ID()) <= $now_time):
       	?>
       	<item>
       		<title><?php the_title_rss() ?></title>
       		<link><?php the_permalink_rss() ?></link>
       		<comments><?php comments_link_feed(); ?></comments>
       		<pubDate><?php //echo localtime_feed_pub_time( get_the_ID() ); 
       		//echo get_post_time('D, d M Y H:i:s O', true);
       		echo date('D, d M Y H:i:s O', get_active_post_time(get_the_ID()));
   
       		?></pubDate>
       		<dc:creator><?php the_author() ?></dc:creator>
       		<?php the_category_rss('rss2') ?>
   
       		<guid isPermaLink="false"><?php the_guid(); ?></guid>
       <?php $description = "This podcast is supported by a handful of faithful listeners. For more information, please visit thetrinitymission.org/giving"?>
       <?php if (get_option('rss_use_excerpt')) : ?>
       		<description><![CDATA[<?php echo $description; ?>]]></description>
       <?php else : ?>
       		<description><![CDATA[<?php echo $description; ?>]]></description>
       	<?php $content = $description; ?>
       	<?php if ( strlen( $content ) > 0 ) : ?>
       		<content:encoded><![CDATA[<?php echo $content; ?>]]></content:encoded>
       	<?php else : ?>
       		<content:encoded><![CDATA[<?php echo $description; ?>]]></content:encoded>
       	<?php endif; ?>
       <?php endif; ?>
       		<wfw:commentRss><?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?></wfw:commentRss>
       		<slash:comments><?php echo get_comments_number(); ?></slash:comments>
       <?php rss_enclosure(); ?>
       	<?php do_action('rss2_item'); ?>
       	</item>
       	<?php endif; //if it is active ?>
       	<?php endwhile; ?>
       </channel>
       </rss>
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-rss-feed-10%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Thread Starter [mtjarrett](https://wordpress.org/support/users/mtjarrett/)
 * (@mtjarrett)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/custom-rss-feed-10/#post-13488435)
 * Not solved but I just started from scratch. Have differnet issues now and will
   start a new thread.

Viewing 1 replies (of 1 total)

The topic ‘Custom RSS Feed’ is closed to new replies.

## Tags

 * [rss-feed](https://wordpress.org/support/topic-tag/rss-feed/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [mtjarrett](https://wordpress.org/support/users/mtjarrett/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/custom-rss-feed-10/#post-13488435)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
