daily pastebin goal
36%
SHARE
TWEET

eaxmple of ajax_wpqsf_reoutput filter

a guest Jul 5th, 2013 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_filter('ajax_wpqsf_reoutput', 'customize_output', '', 2);
  2. function customize_output($results , $args){
  3. // The Query
  4. $query = new WP_Query( $args );
  5. ob_start(); $results ='';
  6. // The Loop
  7. if ( $query->have_posts() ) {
  8. while ( $query->have_posts() ) {
  9. $query->the_post();
  10. echo '<li><a href="'.get_permalink().'" rel="nofollow">'.get_the_title().'</a></li>';//here where you customize the result content
  11. }
  12. } else {
  13. echo 'no post found';
  14. }
  15. /* Restore original Post Data */
  16. wp_reset_postdata();}
  17.  
  18. $results = ob_get_clean();
  19. return $results;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top