notify users when changed database

I don’t want Ajax request to be sent every 2 seconds. Is there a way to send me a notification only if the database changes in a certain meta? You can’t watch the database for changes like this. The most you could do is add filters on post meta changes on the PHP side to … Read more

how to make this work with jquery 1.12.4 [closed]

If you only have one iframe, just set the iframe’s src attribute in the .show() callback function. <script type=”text/javascript”>//<![CDATA[ jQuery(window).load(function($){ setTimeout(function(){ $(‘.hidden_div’).show(function(){ $(this).find(‘iframe’).attr(‘src’, ‘https://example.com/’); }); }, 5000); });//]]> </script> If you need more dynamic code, remove the src attribute of the iframe, and add a new attribute with the url like so <iframe data-src=”https://example.com/”></iframe> And … Read more

Adding jquery using php function

Why are you not using the built-in enqueue_script function? Simply put your custom jQuery code into a file called custom.js, save it into your plugin or theme folder, then enqueue it with jQuery as a dependency: <?php function custom_scripts() { if (is_admin()){ wp_enqueue_script( ‘customjs’, get_template_directory_uri() . ‘/js/custom.js’, array(‘jquery’) ); } } add_action(‘wp_enqueue_scripts’, ‘custom_scripts’); You’ll need … Read more

How to Javascript/jQuery

Just paste this in your functions.php file. It will automatically add jQuery in your theme. function wcs_scripts_styles() { wp_enqueue_script( ‘jquery’ ); } add_action( ‘wp_enqueue_scripts’, ‘wcs_scripts_styles’ ); WordPress automatically include jquery from it’s location. You do not need to upload jquery on your theme. additionally you can also add more scripts lile this. function wcs_scripts_styles() { … Read more