Ajax function is not working on WordPress

Try like this Main HTML: <form class=”home_footer” method=”post” id=”home_conct_form” action=””> <input type=”text” name=”fname” class=”txt” /> <input type=”text” name=”lname” class=”txt” /> <input type=”button” name=”home_submit” id=”home_submit” value=”Get In Touch”/> </form> Add on same page: <script> $(‘#home_submit’).click(function(){ var formData = $(“#home_conct_form”).serialize() $.ajax({ type: ‘POST’, url: ‘<?php echo home_url(“https://wordpress.stackexchange.com/”); ?>wp-admin/admin-ajax.php?action=footerFrm’, data: formData, beforeSend: function(){ $(‘.progloader’).show(); $(‘#home_submit’).hide(); }, success:function(data) { … Read more

Include HTML (Bootstrap Modal Box) with a plugin into my header

You only need the_content filter to add the modal, but bootstrap.js is needed to make it work. add_action(‘wp_enqueue_scripts’, array($this, ‘enqueue_bootstrap’); public function enqueue_bootstrap(){ wp_register_script( ‘bootstrap’, plugins_url( ‘your-plugin/assets/js/bootstrap.min.js’ ) ); wp_enqueue_script( ‘bootstrap’ ); } EDIT: You need to add $content argument to your function. As the codex says Note that the filter function must return the … Read more

Open tab on current day problem jQuery and WordPress

Your problem is one of formatting: <?php add_action( ‘wp_footer’, ‘wpse203799_footerscript’, ’30’ ); }?> There’s a very good reason that programmers follow coding standards, and use editors that automatically format and indent code. If we do these to the code used here, we’ll see this: <?php add_action( ‘wp_footer’, ‘wpse203799_footerscript’, ’30’ ); } ?> This means that … Read more