All I have done is added the ajax-search code into my functions.php
`/**
* Ajax search from wp query search filter
*/
add_filter(‘uwpqsf_result_tempt’, ‘customize_output’, ”, 4);
function customize_output($results , $arg, $id, $getdata ){
// The Query
$apiclass = new uwpqsfprocess();
$query = new WP_Query( $arg );
ob_start(); $result = ”;
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();global $post;
//check post type for the post
if(get_post_type() == ‘aktivitet’){ ?>
<?php
include(‘template-parts/detsker_search.php’);//include the template for post type named ‘type1’
?>
<?php }
if(get_post_type() == ‘detsker’){ ?>
<?php
include(‘template-parts/detsker_search.php’);//include the template for post type named ‘type1’
?>
<?php }
if(get_post_type() == ‘medlem’){ ?>
<?php
include(‘template-parts/medlemmer_search.php’);//include the template for post type named ‘type1’
?>
<?php }
}
echo $apiclass->ajax_pagination($arg[‘paged’],$query->max_num_pages, 4, $id, $getdata);
} else {
echo ‘Der blev ikke fundet noget….!’;
}
/* Restore original Post Data */
wp_reset_postdata();
$results = ob_get_clean();
return $results;
}
And the ajax search have worked – thats why I can’t figure out where it has gone bad:)