AJAX search on post pages by custom post type
Instead of ‘cat’ => 12 and $wp_query use ‘category_name’ => slug and get_posts(). Here is a basic example how it works: PHP add_action( ‘wp_loaded’, array ( ‘T5_Ajax_Search’, ‘init’ ) ); /** * Ajaxify the search form. */ class T5_Ajax_Search { /** * The main instance. You can create further instances for unit tests. * @type … Read more