Load more AJAX on WP Query
if you want to use ajax in wordpress you must have to follow these step: 1) first make your js file like main.js. 2) localize it in functions.php with wp_localize_script(). wp_enqueue_script( ‘main.js’, get_template_directory_uri().’/js/main.js’, array( ‘jquery’ ) ); wp_localize_script( ‘main.js’, ‘ajax_object’, array(‘ajax_url’ => admin_url(‘admin-ajax.php’)) ); 3) make your javascript or jquery code to run your query … Read more