Using Enfold, I created a secondary menu with three custom links in it. I need the third one to open in a lightbox. Example:
Phone number (custom link): links to tel:1234567890
Apply (custom link): links to external site ex: google.com
Request (custom link): Links to a page : /request-information?iframe=true
I’ve then added this to the child-functions file:
// custom script
add_action( ‘wp_footer’, ‘ava_custom_script’ );
function ava_custom_script() {
?>
<script type=”text/javascript”>
(function($) {
function b() {
$(“#header_meta a”).magnificPopup({
type: ‘iframe’,
mainClass: ‘avia-popup mfp-zoom-in’,
});
}
$(window).load(function() {
b();
});
})(jQuery);
</script>
<?php
}
With this functions script added, it opens ALL three links in a lightbox. Without it, doesn’t open the third menu item in a lightbox.
Question: What is needed to make only the third button open in a lightbox?
Thanks in advance. You guys are the best.
Hey CoreyNordwall,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
Victoria
The top pink “Request info” button opens in a lightbox, the “phone number” and “apply now” which are normal links should not.
Hi,
Please try to replace #header_meta in your code with this ID instead: #menu-item-47
Best regards,
Rikard
That’s it. You’re the best! Thank you.
Hi CoreyNordwall,
Glad that we could help :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko