Im using the default wordpress RSS widget to pull in a feed of what TV shows are currently playing on a small TV station. For reasons beyond my control, whenever this TV station plays a certain file, the feed calls it “NA”. I have no control over the feed, so I was wondering if it would be possible to use some php to replace that specific string with something else. I’ve found some php that would let me do this
<?php // The text string $text = "The quick brown fox jumped over the lazy dog."; // The word we want to replace $oldWord = "brown"; // The new word we want in place of the old one $newWord = "blue"; // Run through the text and replaces all occurrences of $oldText $text = str_replace($oldWord , $newWord , $text); // Display the new text echo $text; ?>
but i’m not sure where i’d need to put that in my wordpress files, or what variables i’d use to change the rss description. Can anyone help me out with this? For an example, go to http://www.yourconcordtv.org/wptest/ and look at the ‘Now Playing’ section on the sidebar.
- The topic ‘Replace string in RSS Widget?’ is closed to new replies.