Ultimate WordPress Query Search Filter – Customize Output

Customize the output to match your theme.

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; 
 echo '<li>'.get_permalink().'</li>'; 

 } 

 echo $apiclass->ajax_pagination($arg['paged'],$query->max_num_pages, 4, $id, $getdata); 

 } else {

 echo 'no post found';

 } 

 /* Restore original Post Data */ 
 wp_reset_postdata(); 
 $results = ob_get_clean(); 
 return $results; 

}

Sourced here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.