-
AuthorPosts
-
February 16, 2019 at 10:36 am #1067675
Hi all, please help me. I have followed a video tutorial posted here to do this but lost the link and can’t get this working, so here is my situation and problem:
1. I do not have a child theme
2. I created a “custom link” button style in my menu in appearance menu structure
3. I created a color section on my home page where I have a Icon List in but the color section is hidden with Custom Css class: mfp-hide
4. I have the plugin “My Custom Functions” installed and added this:
function inline_popup_enabler(){
?>
<script>
(function($){
$(window).load(function() {
$(‘.inline_popup’).magnificPopup({
type:’inline’,
midClick: true
});
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘inline_popup_enabler’);
5. Problem is I don’t get any action if I click on the Custom Link Button created in the menu.
I want it to popup a block showing the Icon List once clicked on the button in my menu….
Please help….February 16, 2019 at 10:22 pm #1067827Hey cateringequipment,
Your function doesn’t include the name of the function for the “add action” to trigger, add it doesn’t close the PHP before adding the jQuery script. Assuming that you are creating a link to fire the class “inline_popup” then try replacing your function with this one in your functions.php:function popup_inline() { ?> <script type="text/javascript"> jQuery(window).load(function(){ jQuery('.inline_popup').magnificPopup({ type:'inline', midClick: true }); }); </script> <?php } add_action('wp_head', 'popup_inline');If this doesn’t help, please include a admin login in the private content area so we can be of more assistance.
Best regards,
MikeFebruary 18, 2019 at 7:34 am #1068159This reply has been marked as private.February 19, 2019 at 2:45 am #1068707Hi,
Thanks for the login, but I’m unable to add the function to your functions.php, your site says we should try via FTP.
So please include a FTP login in the Private Content area.Best regards,
MikeFebruary 22, 2019 at 9:23 am #1070265This reply has been marked as private.February 22, 2019 at 2:32 pm #1070346Hi,
Thanks for the ftp access, I added the code to your functions.php, but I can’t login to test and make the other changes needed, please check the admin login you posted above.Best regards,
MikeFebruary 22, 2019 at 4:57 pm #1070390This reply has been marked as private.February 23, 2019 at 5:43 am #1070562Hi,
Thank you, well I got it working for you by rebuilding the menu button with jQuery, for some reason the menu button didn’t want to trigger the script. The only issue is that you can’t trigger the popup from another page, that is it won’t send you to the homepage and then open the popup.
But if you copy the popup (color section and icon list) with the “save entry as template” tool you can add it to your other pages.
Also, because you are using a color section the popup is full width, this is because the color section is full width.
Please clear your browser cache and check.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.
