UserPro Forums
  • Create new topic
  • Forums
    • No replies topics
    • Newest topics
    • Forum statistics
  • Account
    • Lost password
    • Register
    • Login
  • Documentation
  • Back to main site

Community Forums

User To User Support Forum/Forums/Support Questions (UserPro)/Add Class=popup-login

Add Class=popup-login

menupopup login
  • 8 years, 10 months ago Avatargiraffa
    Participant

    I want to add the popup-login to the menu:

    When I try to add class to the navigation it input the class to the li element.

    How can I add the class to the a element?

    Login

    10X

    Giraffa-Media

    8 years, 10 months ago Avataradmin
    Keymaster

    Hi there, please read the rules first 🙂

    http://userproplugin.com/userpro/forums/topic/please-read-the-support-rules-before-posting/

    8 years, 10 months ago Avatargiraffa
    Participant

    ok
    read it,
    1)I already verified my account here before (should i do it every time i post?!)
    2)I didnt think that i need URL because the problem doesn’t required it but

    YOGA74.CO.IL

    i want on of my menu links to open with popup-login.

    10X for the help

    Giraffa

    8 years, 10 months ago Avataradmin
    Keymaster

    Add the class popup-login to nav menu class or link class to activate Login popup.

    8 years, 10 months ago Avatargiraffa
    Participant

    Ok I can see the popup,
    (1) is any way to design some other popup? how can i cotrol the design of this? it look weird…
    (2) Is the “login” link can change to “logout” after loging in? (i think this is the right way right? maybe even i can design it to be with the user profile picture?)

    10X
    GIRAFFA

    8 years, 10 months ago Avatargiraffa
    Participant

    Can you Please help me understand the last thing i asked?

    8 years, 10 months ago Avatarkabadabra
    Participant

    Example of my code with login/logout

    PHP
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    <?php
    if ( is_user_logged_in() ) {
    ?>
         <a href="<?php echo wp_logout_url( $redirect ); ?> " class="btn btn-danger pull-right">Logout</a>
    <?php
    } else {
    ?>
         <a href="#" class="popup-login btn btn-success pull-right" data-login_button_secondary="">Login</a>
    <?php
    }
    ?>
     

    Edit: Can’t seem to get code tags right, here’s an image example:

    8 years, 10 months ago Avatargiraffa
    Participant

    10X
    but where should i put this code?

    8 years, 10 months ago Avatarkabadabra
    Participant

    In your theme’s template… for example header.php or wherever you want these login/logout buttons to appear.

    To add it to a menu, here’s a good example: http://www.wpsymposium.com/2013/02/add-loginlogout-automatically-to-wordpress-menu/

    8 years, 10 months ago Avatargiraffa
    Participant

    ok i want to add to the menu,
    i add the code, but know what should i do? add id to the menu li? how?
    please take a look here

    URL
    http://www.giraffa-media.co.il/test/

    10X for your help man

    GIRAFFA

    8 years, 10 months ago Avatarkabadabra
    Participant

    Here you go – tested and works:

    http://jsfiddle.net/yaLLF/4/

    Add this to your functions.php and make changes as necessary.

    Alternatively you can maybe try this plugin?

    Login Logout Menu

    8 years, 10 months ago Avatargiraffa
    Participant

    10X I installed the plugin but just to understand one last thing,

    After i added this to the functions.php, what else should i do?
    I need to add the php to the header right? is there anything else?

    10X Very Much!
    Have A good day

    Giraffa

    8 years, 10 months ago Avatarkabadabra
    Participant

    You can use the plugin I mentioned above OR you can use my code in your functions.php file.

    If you want to use my code the only thing you have to change is the $theme_location variable to whatever you menu location variable is. For example my main menu location is called “main_menu”. There shouldn’t be anything else you need to do.

    If you’re using the plugin, haven’t test the plugin yet, but I am assuming you will add it to the menu via the UI and choose the login|logout option and add the “popup-login” variable to the menu item.

    Had a look on your website and see you have implemented it.

    8 years, 10 months ago Avatargiraffa
    Participant

    Ok thanks for explaing!!!
    i rather do it with this code and use less plugins. (it make sense right?)

    But one more thing:

    do you know/thing it’s possible to have a different control over the login/logout because i realy want after login the user to see “my profile” and have a little drop down with few options (“my followers, my profile, log-out”), including the profile picture in small thumbnail, like it is in many website.

    Show i try figure this out or is it possible to do this with the plugin?

    10X
    Nir

    8 years, 10 months ago Avatarkabadabra
    Participant

    Easiest way would be to use conditional statements, something like this plugin should help: http://wordpress.org/plugins/if-menu/

    If you are familiar with WordPress filters then you can code something in functions.php to make it work.

Viewing 15 posts - 1 through 15 (of 20 total)
1 2 →

You must be logged in to reply to this topic.

Disclaimer

This forum is 100% free and USER to USER support only. Technical support staff doesn’t monitor this forum actively.

If you are a customer and want to get technical support from our staff please submit a technical support ticket here: UserPRO Technical Support

Recent Topics

  • Custom Badges AddOn Plugin here
  • Green Trust Cash APplication
  • How to use cash app without a bank account
  • Install Cash App on your Device [100%] by yourself | Step-by-Step Guide
  • Green Trust Cash Application

About forum

Here you can find help from UserPro plugin developers and other UserPro fellow users. Please be polite and ask your questions. NO SPAM!

Search Forums

Follow us

  • facebook
  • twitter
  • youtube
© Copyright UserPro