php - How can I include Jquery in my Wordpress footer? -
i want .load php script every 10 seconds. load code not problem, in wordpress plugins use own jquery libraries, , if add jquery google link:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
the other plugins crash.
i have following code in footer:
<?php if ( is_user_logged_in() ) { include 'completed.php'; } ?>
i want include jquery script can execute following code:
<?php if ( is_user_logged_in() ) { ?> <div id="completed"> <script> $(function(){ setinterval(function(){ $("#completed").load("completed.php"); }, 10 * 1000); }); </script> </div> <?php } ?>
do think can me out?
load jquery google ajax library in footer
function my_init() { if (!is_admin()) { // comment out next 2 lines load local copy of jquery wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, '1.3.2', true); wp_enqueue_script('jquery'); } } add_action('init', 'my_init');
Comments
Post a Comment