Created
November 13, 2025 01:53
-
-
Save PUYUP/4a7d46d7ddb502b9ce615eee405972fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // masukkan ini kedalam functions.php child theme tepat didalam function zox_news_child_enqueue_styles() {} | |
| // tujuan penambahan ini adalah untuk memamnggil file js custom | |
| wp_enqueue_script( 'zox-news-child-script', get_stylesheet_directory_uri() . '/js/ln-child.js', array('jquery'), null, true ); | |
| // kemudian buat file javascript baru didalam folder /wp-content/themes/zox-news-child/js/ln-child.js | |
| // paste ini kedalamnya | |
| jQuery(document).ready(function($) { | |
| $(document).on('click', '.cta-wa a', function() { | |
| var phoneNumber = '6282329015769'; // Ganti dengan nomor WhatsApp tujuan | |
| var pageUrl = window.location.href; | |
| var message = `[LH.BLOG] - Halo, saya mengunjungi blog LindungiHutan tentang ${pageUrl} dan ingin bertanya.`; | |
| var waLink = `https://api.whatsapp.com/send/?phone=${phoneNumber}&text=${encodeURIComponent(message)}`; | |
| window.open(waLink, '_blank'); | |
| }); | |
| })( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment