How To Close A Mobile Popup Menu in Elementor for a One-Page Site

If you’re making a one-page / landing page site and want to have the mobile popup menu close after clicking on a link, copy the following code:


<!-- Close Popup once anything within popup is clicked. -->
<script>
jQuery(function($){
$(document).on('click','.elementor-location-popup a', function(event){
elementorProFrontend.modules.popup.closePopup( {}, event);
});
});
</script>

Now, paste it into an HTML widget that you’ll put onto the bottom of the popup menu.

Other Helpful Articles

Disable Product Pages in WooCommerce

Add the following code to your functions.php file to disable users from accessing product pages within WooCommerce: /* Remove Links to Access Product Pages */ remove_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 ); remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_product_link_close’, 5 ); /* Prevent Users from Accessing Product Pages by Displaying the 404 Page */ function prevent_access_to_product_page(){

Read More »

How To Disable HTML in WordPress Comments

If you don’t want users to post HTML in comments on your site, you can post the code below into your WordPress theme’s functions.php file: /* Disable Hyperlinks in WordPress Comments */ remove_filter(‘comment_text’, ‘make_clickable’, 9); add_filter(‘pre_comment_content’, ‘strip_comment_links’); function strip_comment_links($content) { global $allowedtags; $tags = $allowedtags; unset($tags[’a’]); $content = addslashes(wp_kses(stripslashes($content), $tags));

Read More »

What Do You Need Done?:

(Please check all that apply)

Tell Us About You

Almost Done!

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info

Let's Get Some Info