Tagged: , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #6383

    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’) {


    function add_login_logout_link($items, $args) {

    if($args->theme_location == 'Primary') {

    $loginoutlink = ob_get_contents();

    $items .= '
    <li>'. $loginoutlink .'</li>


    return $items;




    the theme location for the sub menu is “avia2″ instead of “Primary”.


    Excellent! Thanks!!!

    Thanks also for fixing the display of the post after I added the code snippet.

    I have been building my site over the past few hours and the theme is awesome :-)


    Glad that I could help you :)

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Adding a Login/Logout Menu Item’ is closed to new replies.