Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #984389

    Hello,

    Currently I have this code in my function.php to add a log in/log out nav item to my nav bar:

    
    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;
    }
    

    Is there a filter I can use to get this in the Header Phone Number/Extra Info area? I tried the avia_meta_header hook with no success.

    Thank you!

    #984468

    Hey cliffrobbins,
    Sorry, I don’t believe there is, but we might be able to write some javascript to move it there for you.
    Please link to the page in the Private Content area so we can take a closer look.
    If you can also include a mockup of what you would like to see, it would be helpful.

    Best regards,
    Mike

    #984828

    I have a placeholder in the header extra element saying “Log in Link to Go HERE” where I want the log in/out prompt to be. I want it to say ‘Log In’ to non-logged in users and ‘Log Out’ to logged in users. The code I provided already does this so really I just need a way for my code to be implemented in the header extra element area.

    Thank you!

    #984933

    Hi,
    Can you please include a admin login in the private content area, I would like to add a class to the login link, right now it doesn’t have any.

    Best regards,
    Mike

    #985211

    Login access in private content.

    #985367

    Hi,
    I tried to add a class to your login/logout button in your functions.php, but received an error to try via ftp. Please try to do this by chainging this line:

    $items .= '<li class="login-btn">'. $loginoutlink .'</li>';

    Then you can add this code to the end of your functions.php file in Appearance > Editor:

    function move_login_btn(){
      ?>
      <script>
      jQuery(window).load(function(){
      jQuery( ".login-btn" ).appendTo( ".login-loc" );
      });
      </script>
      <?php
      }
     add_action('wp_footer', 'move_login_btn');
    

    I have added this code to your phone-info field as the target:

    <span class="login-loc"></span>

    Then please add this code in the General Styling > Quick CSS field to remove the list bullet:

     .login-loc {
    list-style-type:none;
    }

    Best regards,
    Mike

    #986679

    Worked very well, thank you Mike!

    #986735

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

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

The topic ‘Filter for Header Extra Info’ is closed to new replies.