-
AuthorPosts
-
July 11, 2018 at 11:45 pm #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!
July 12, 2018 at 4:56 am #984468Hey 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,
MikeJuly 12, 2018 at 5:27 pm #984828I 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!
July 13, 2018 at 3:09 am #984933Hi,
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,
MikeJuly 13, 2018 at 4:22 pm #985211Login access in private content.
July 14, 2018 at 3:37 am #985367Hi,
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,
MikeJuly 17, 2018 at 10:30 pm #986679Worked very well, thank you Mike!
July 18, 2018 at 3:41 am #986735Hi,
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 -
AuthorPosts
- The topic ‘Filter for Header Extra Info’ is closed to new replies.