WordPress.org

Ready to get started?Download WordPress

Forums

wp_loginout() placement (1 post)

  1. Kasper Isager
    Member
    Posted 3 years ago #

    Hello all!

    First of all a link to my site: http://xn--eventmors-t8a.dk/
    At the moment I'm trying to add wp_loginout() to my header. I've placed it after calling my nav-menu, but the 'Log in' and 'Log out' buttons still appear after the menu and not before. This is the header code:

    if (function_exists('wp_nav_menu')) { ?>
    
                      <?php if (is_user_logged_in()) { ?>   
    
                         <?php $primaryNav = wp_nav_menu( array( 'theme_location' => 'logged-in-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); ?>
                         <ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
                            <?php wp_loginout($_SERVER['REQUEST_URI']); ?>
    
                      <?php } else { ?>
    
                         <?php $primaryNav = wp_nav_menu( array( 'theme_location' => 'logged-out-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) ); ?>
                         <ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
                            <?php wp_loginout($_SERVER['REQUEST_URI']); ?>
    
                      <?php }
                   };

    I can't seem to make wp_loginout() appear AFTER the menu. Any ideas? This is just a small detail, but it doesn't really make sense having the Log in button appear before the menu itself.

Topic Closed

This topic has been closed to new replies.

About this Topic