Inspired by http://vanweerd.com/enhancing-your-wordpress-3-menus/
I would like to add the following code to enable a "Log in" / "Log out" link but only on the Template's sub menu.
The code is added to the theme's functions.php
Q) Please can you tell me what this should be changed to or even suggest your preferred method:
if($args->theme_location == 'Primary') {
Thanks!
-----
function add_login_logout_link($items, $args) {
if($args->theme_location == 'Primary') {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '
<li>'. $loginoutlink .'</li>
';
}
return $items;
}














