Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 135017

trunham on "pre_get_posts() breaking permalinks"

$
0
0

Hey guys,

The exact code is:

function search_filter($query) {
  if ( !is_admin() && $query->is_main_query() ) {
     $query->set('post_type', array( 'post' ) );
  }
}
add_action('pre_get_posts','search_filter');

This appears to break all of my page links except for one which re-directs to a post for some reason. It happened after updating to 3.8 although i guess the code could be wrong too. Any help would be much appreciated!

Thanks


Viewing all articles
Browse latest Browse all 135017

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>