Login / logout url
-
Hi there,
I found a login / logout url code on this site which i placed in my functions.php
The code worked fine except that it places the login logout link in two places on my site. I have a top menu and a main menu. Ideally i would like the link showing only for the top menu.
Is there a way to do that? Please find the code below. My website address is http://www.ghanalandlords.com/
Thank you
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2); function add_login_logout_link($items, $args) { ob_start(); wp_loginout('index.php'); $loginoutlink = ob_get_contents(); ob_end_clean(); $items .= ' <li>'. $loginoutlink .'</li> '; return $items; }
[In future please wrap code in backticks or using the “code” button]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Login / logout url’ is closed to new replies.