Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #296917

    HI,

    I would like to open a popup using a link in secondary menu. To do that I need to put this class in the link:

    class=open-popup-link

    How can I put this class in a link on secondary menu?

    THANKS

    #296920

    Hey CloudChoice!

    Please go to Appearance > Menus and click on “Screen options” and check “CSS classes” – http://i.imgur.com/ywOvDce.png

    Best regards,
    Yigit

    #296948

    Ohhh good! Sorry by the stupid question. :)

    BUT the link is not working. I inserted the class “open-popup-link”, but the popup not open.
    I see in the code that the class is out of the href attribute.

    <li id=”menu-item-6276″ class=”open-popup-link menu-item menu-item-type-custom menu-item-object-custom menu-item-6276″>Login

    What can I do about that?

    #296961

    Hey!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('li#menu-item-6276>a').addClass('open-popup-link');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Best regards,
    Yigit

    #296990

    Hi,

    The code crashed the site.
    I would like to add the same in child theme.

    #296993

    Hey!

    Maybe you have any other script with the same function name. Please try copy&pasting the code from here to your child theme’s functions.php file – http://pastebin.com/HdcsTZhh

    Cheers!
    Yigit

    #297037
    This reply has been marked as private.
    #297136

    Hey!

    Thank you for the update.

    The class open-popup-link is being added on the link but I think the problem is with the lighbox script or plugin that you’re using. Unfortunately, we won’t be able to provide support for third party plugins. Please contact the plugin author.

    Regards,
    Ismael

    #297139

    HI,

    Sorry, but the there isn´t any plugin or third soft part in this case!

    I using the ligth box of the Enfold Theme!

    #297155

    Hi,

    1 – The class open-popup-link is not really on the link. Just check the code using “view source code of the page”
    2 – The class open-popup-link is a class of the magnific popup, The same is used by the Enfold Theme after the change of Pretty Photo.
    3 – Just check the blue buton LOGIN in the botton of the page and you will see the popup working normally.
    4 – In the same page the link “Meu Pedido” call the popup normally too!

    Therefore the problem is not in the magnific popup. The problem is in other point!

    Any suggestion?

    #297159

    Hey!

    Change this part of the code i gave you previously:

    <script>
    jQuery(window).load(function(){
    jQuery('.open-popup-link-button a, .open-popup-link').magnificPopup({type:'inline',midClick:true});
    });
    </script>
    

    To:

    <script>
    jQuery(window).load(function(){
    jQuery('.open-popup-link-button a, .open-popup-link, #menu-item-6276 a').magnificPopup({type:'inline',midClick:true});
    });
    </script>
    

    Regards,
    Josue

    #297176

    You are the guy!!! Perfect!

    Thank you very much.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Class in a link on secondary menu’ is closed to new replies.