Ajax Dynamic Archives not showing correct results
this is what i ended up with which works nicely. functions.php part <?php function scripts_enqueue() { if(is_page(‘archives’)) { wp_enqueue_script(‘ajax_dropdown’, get_stylesheet_directory_uri() . ‘/js/loadposts.js’,array(‘jquery’)); wp_localize_script( ‘ajax_dropdown’, ‘myajax’, array(‘custom_nonce’ => wp_create_nonce(‘nonce-ajax-dropdown’), ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) ) ); } } add_action( ‘wp_enqueue_scripts’, ‘scripts_enqueue’ ); function wp_ajax_load_posts(){ if(!wp_verify_nonce( $_GET[‘_wpnonce’], ‘nonce-ajax-dropdown’)) die( ‘Go away!’ ); $args = array( ‘year’ => … Read more