From 591d195200773c1d0c3a344bda72b57289a1f7dc Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 4 Apr 2018 08:10:46 -0400 Subject: [PATCH] adding logout link if logged in adding log out link if logged in --- functions.php | 13 ++++++++++++- header.php | 5 +---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/functions.php b/functions.php index 6e7c74e..7fe5acb 100644 --- a/functions.php +++ b/functions.php @@ -257,4 +257,15 @@ function accesspress_parallax_get_my_option(){ add_action("wp_ajax_get_my_option", "accesspress_parallax_get_my_option"); -define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/options-framework/' ); \ No newline at end of file +define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/options-framework/' ); + +function add_logout($items, $args) { + $url = wp_logout_url( home_url() ); + if( $args->theme_location == 'login' ){ + $items .= ""; + } + return $items; +} +add_filter('wp_nav_menu_items', 'add_logout', 10, 2); \ No newline at end of file diff --git a/header.php b/header.php index 5692b33..9f8cd06 100644 --- a/header.php +++ b/header.php @@ -47,10 +47,7 @@ 'theme_location' => 'login' , 'container' => false ) ); - wp_nav_menu( array( - 'theme_location' => 'logout' , - 'container' => false - ) ); + wp_nav_menu( array( 'theme_location' => 'primary' , 'container' => false -- 2.17.1