Skip to content

Instantly share code, notes, and snippets.

@regisd
Created May 23, 2012 00:10
Show Gist options
  • Save regisd/2772460 to your computer and use it in GitHub Desktop.
Save regisd/2772460 to your computer and use it in GitHub Desktop.
Wordpress theme "response" by Cyberchimps should use the same RSS in the icon link and alternate link
// add this function in functions.php
/** Replaces RSS link from HTML 'head' with custom feed also used with the 'social icon' */
function response_feed_links() {
global $themename, $themeslug, $options;
$my_feed=$options->get($themeslug.'_rsslink');
if ($my_feed) {
echo '<link rel="alternate" type="application/rss+xml" title="RSS feed" href="'.$my_feed.'"/>';
}
else {
feed_links();
}
}
remove_action( 'wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed
add_action('wp_head', 'response_feed_links');
@cyberchimps
Copy link

Thank you for taking the time to write this out, but can I ask what we would gain by adding this function? Our current RSS links including our social icon seem to be just fine.

Thanks.

@regisd
Copy link
Author

regisd commented May 23, 2012 via email

@cyberchimps
Copy link

Ah I see. Yes that makes a lot of sense, I will go ahead and use your code in our next round of updates. Thank you very much!

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