Skip to content
This repository has been archived by the owner on Mar 4, 2018. It is now read-only.

Commit

Permalink
disabled altering of main query in search results. fixes part of #66
Browse files Browse the repository at this point in the history
Custom post types will now appear in search results as intended.
  • Loading branch information
zyml committed May 21, 2013
1 parent ff75349 commit b5e4a94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/classes/postviews-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ protected function prepare_query() {
global $wp_query;

if ( $this->settings[ 'use_main_query' ] ) {
add_action( 'pre_get_posts', array ( $this, 'alter_main_query' ) );
if ( !is_search() ) {
add_action( 'pre_get_posts', array ( $this, 'alter_main_query' ) );
}
$this->query = &$wp_query;
$this->query->get_posts();
} else {
Expand Down

0 comments on commit b5e4a94

Please sign in to comment.