Guest User

Untitled

a guest
Mar 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function gg_postssearch($query) {
  2. if( is_single( 'post' ) || is_post_type_archive( 'post' ) {
  3. if( $query->is_search ) {
  4. $query->set( 'post_type', 'post' );
  5. }
  6. return $query;
  7. }
  8. }
  9. add_filter( 'pre_get_posts',' gg_postssearch' );
Add Comment
Please, Sign In to add comment