Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Created April 29, 2013 14:18
Show Gist options
  • Save jamiemitchell/5481837 to your computer and use it in GitHub Desktop.
Save jamiemitchell/5481837 to your computer and use it in GitHub Desktop.
Add Login/out to primary nav
<?php
/* Add Login/out to primary nav
------------------------------------------------------------ */
add_filter('wp_nav_menu_items','my_item', 11, 2);
function my_item($items, $args) {
if( is_admin() || $args->theme_location != 'primary' )
return $items;
$items .= '<li class="right">' . do_shortcode('[footer_loginout redirect="http://yoursite/members/"]') . '</li>';
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment