-
AuthorPosts
-
July 28, 2014 at 5:46 pm #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
July 28, 2014 at 6:00 pm #296920Hey CloudChoice!
Please go to Appearance > Menus and click on “Screen options” and check “CSS classes” – http://i.imgur.com/ywOvDce.png
Best regards,
YigitJuly 28, 2014 at 7:36 pm #296948Ohhh 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?
July 28, 2014 at 8:07 pm #296961Hey!
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,
YigitJuly 28, 2014 at 9:13 pm #296990Hi,
The code crashed the site.
I would like to add the same in child theme.July 28, 2014 at 9:19 pm #296993Hey!
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!
YigitJuly 28, 2014 at 10:30 pm #297037This reply has been marked as private.July 29, 2014 at 4:33 am #297136Hey!
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,
IsmaelJuly 29, 2014 at 4:37 am #297139HI,
Sorry, but the there isn´t any plugin or third soft part in this case!
I using the ligth box of the Enfold Theme!
July 29, 2014 at 5:10 am #297155Hi,
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?
July 29, 2014 at 5:35 am #297159Hey!
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,
JosueJuly 29, 2014 at 6:45 am #297176You are the guy!!! Perfect!
Thank you very much.
-
AuthorPosts
- The topic ‘Class in a link on secondary menu’ is closed to new replies.