Created
September 22, 2015 19:25
-
-
Save JudeRosario/c3f7670c4f3653848ce2 to your computer and use it in GitHub Desktop.
Change RSS feeds url
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just copy/paste the code into the functions.php file of your child theme or a site specific plugin if you use one.