Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created September 22, 2015 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudeRosario/c3f7670c4f3653848ce2 to your computer and use it in GitHub Desktop.
Save JudeRosario/c3f7670c4f3653848ce2 to your computer and use it in GitHub Desktop.
Change RSS feeds url
add_action('wp_footer', 'custom_JS') ;
function custom_JS() {
echo <<<'JS'
<script type="text/javascript">
jQuery(document).ready(function ($) {
if(window.location.href.indexOf("/tags/") > -1) {
var loc = location.href;
loc = loc.lastIndexOf('/') == (loc.length -1) ? loc.substr(0,loc.length-1) : loc.substr(0,loc.lastIndexOf('/'));
var tag = loc.substr(loc.lastIndexOf('/') + 1);
var feedurl = "https://blogs.caryacademy.org/wp-content/tag-feed.php?tag=" + tag ;
jQuery(".et-social-rss a").attr("href", feedurl ) ;
}
});
</script>
JS;
}
@JudeRosario
Copy link
Author

Just copy/paste the code into the functions.php file of your child theme or a site specific plugin if you use one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment