Skip to content

Instantly share code, notes, and snippets.

@StewartChamberlain
Created July 28, 2013 11:09
Show Gist options
  • Save StewartChamberlain/6098226 to your computer and use it in GitHub Desktop.
Save StewartChamberlain/6098226 to your computer and use it in GitHub Desktop.
<?php
/** Do NOT include the opening php tag */
/** Add Rss Icon To Menu */
add_filter( 'genesis_nav_items', 'sc_nav_rss', 10, 2 );
add_filter( 'wp_nav_menu_items', 'sc_nav_rss', 10, 2 );
function sc_nav_rss($menu, $args) {
$args = (array)$args;
if ( 'primary' !== $args['theme_location'] )
return $menu;
$feedurl = ( get_option('siteurl').'/feed/' );
$menu .= '<a href="' . $feedurl . '" class="menu-rss">Rss Feed</a>';
return $menu;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment