Last active
          December 15, 2015 16:59 
        
      - 
      
- 
        Save renanlara/5292689 to your computer and use it in GitHub Desktop. 
    Search Filter
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // Search Filter xD | |
| function fb_search_filter($query) { | |
| if ( !$query->is_admin && $query->is_search) { | |
| $query->set('post__not_in', array(557,30,4,598,682) ); // id of page or post | |
| } | |
| return $query; | |
| } | |
| add_filter( 'pre_get_posts', 'fb_search_filter' ); | |
| ?> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment