Adding the modern theme login popup link in menu

  1. Please add the given script in your wplms -> footer -> google Anaylitics code :
    <script>
    jQuery(document).ready(function($){
       $('.login_trig').click(function(){
     	$('body').find('#login_trigger').trigger('click');
       });
     });
    </script>

    For modern theme 2.0 or greater :

    <script>
    jQuery(document).ready(function($){
       $('.login_trig').click(function(){
     	$('body').find('#login_modern_trigger').trigger('click');
       });
     });
    </script>

     

    2. Now goto appearance  -> menu .Add a custom link .
    Put the class ” login_trig ” and href  ” #login ” .

    To open popup on a button click :

    a. Please provide ” login_trig ” class to the button :
    You can add the button with the help of button shortcode :

    [button url=”#” bg=”#ffcc00″ size=”20px” class=” login_trig” ]LOG IN[/button]

    3. Please add the given code in wplms-customizer.php file in wplms customizer plugin  :

    add_action('wp_footer','hide_login');
    function hide_login(){
     if(is_user_logged_in()) 
    echo '
     <style>.login_trig{display:none !important;}</style>
     ';
    }

Was this article helpful?

2 Comments

  1. dfarjoun

    It would be nice to see an image showing the result of this implementation!

  2. skumari

    What happens if the custom link doesn’t have a CSS Classes option?

Leave A Comment?