How to pass modified post to RSS feed?

I run a group of restaurant sites. Each site has a CPT called ‘Specials’. The restaurant staff just fill in the new specials of the day in the same posts each morning and update the post. Then the site displays the post at the correct time (breakfast specials in the morning, etc.).
I’m trying to make a page aggregating all the restaurants’ specials on their corporate page using RSS. They all work except one which will not update. The code I’m using to pull the feed:

$rss = new DOMDocument();
$rss->load(‘https://arestaurant.com/feed/?post_type=specials’);
$feed = array();
foreach ($rss->getElementsByTagName(‘item’) as $node) {
$item = array (
‘title’ => $node->getElementsByTagName(‘title’)->item(0)->nodeValue,
‘link’ => $node->getElementsByTagName(‘link’)->item(0)->nodeValue,
‘date’ => $node->getElementsByTagName(‘pubDate’)->item(0)->nodeValue,
‘content’ => $node->getElementsByTagName(‘encoded’)->item(0)->nodeValue
);
array_push($feed, $item);
}
$limit = 1;
for($x=0;$x<$limit;$x++) {
$title = str_replace(‘ & ‘, ‘ &amp; ‘, $feed[$x][‘title’]);
$link = $feed[$x][‘link’];
$content = $feed[$x][‘content’];
$date = date(‘l F d, Y’, strtotime($feed[$x][‘date’]));
echo ‘<p><strong>’.$title.'</strong><br />’;
echo ‘<small><em>Posted on ‘.$date.'</em></small></p>’;
echo ‘<p>’.$content.'</p>’;

I’ve been going crazy trying to figure out how the RSS feeds on the other sites ‘know’ that a post has been changed and should be displayed and why this one doesn’t. I don’t even know how to really ask the question correctly, which kind of gives an idea of my lack of knowledge in this area.
All sites were built using roughly the same files with simple style changes, for the most part. The post-types.php files are the definitely the same.

Can anybody point me in the right direction?

Read more here:: How to pass modified post to RSS feed?

Leave a Reply

Your email address will not be published. Required fields are marked *