in file functions.php, Guys input below code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
add_filter( 'gform_confirmation', 'mrtung_custom_confirmation', 10, 4 ); function mrtung_custom_confirmation( $confirmation, $form, $entry, $ajax ) { add_filter( 'wp_footer', 'mrtung_custom_confirmation_popup'); return '<div class="mrtung-gform-notification-out" ><div class="mrtung-gform-notification-in" >' . $confirmation . '<a class="button-close" href="#">X</a></div></div>'; } function mrtung_custom_confirmation_popup(){ ?> <script type="text/javascript"> jQuery(function($){ $(document).on('click',".mrtung-gform-notification-out .button-close",function() { $(".mrtung-gform-notification-out, .mrtung-gform-notification-in").fadeOut("normal", function() { $(this).remove(); }); }); }); </script> <style> .mrtung-gform-notification-out { overflow: hidden; position: fixed; left: 0; display: flex; right: 0; bottom: 0; height: 100vh; background: rgba(0,0,0,.5); z-index: 999999999999999; } .mrtung-gform-notification-in { display: block; overflow: hidden; position: relative; width: 100%; max-width: 520px; margin: auto; background: #fff; /* margin-top: 7%; */ border-radius: 5px; padding: 20px; text-align: center; } .mrtung-gform-notification-in a.button-close { position: absolute; z-index: 9999; top: 6px; right: 19px; } </style> <?php } |
Mọi sự sao chép xin ghi rõ nguồn là fcwordpress.net
Chuyên trang về wordpress: hướng dẫn thiết kế theme, plugin, thủ thuật wordpress