wordpress ajax is not working for dropdown selection
The first issue I see is the ajax url is incorrect. Your wp_localize_script() has the handle name ‘main’, not ‘ajax_object’. url: main.ajaxurl Also, where is the callback code to handle the get_program_by_category ajax action? You’re missing two actions. add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_action’, ‘my_action_callback’ ); See the WordPress Codex to learn more about using … Read more