From 19e2ed50f60e33870512e8fbaaba6e2f59fd7d97 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 16 Jul 2015 13:55:36 -0400 Subject: [PATCH] Redo search put check for the searchType into the seaorch page and skip showing page post_types if searchType is blog --- root/functions.php | 19 ++++--------------- root/search.php | 11 ++++++----- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/root/functions.php b/root/functions.php index 7fae8c9..8edc962 100644 --- a/root/functions.php +++ b/root/functions.php @@ -102,17 +102,6 @@ if (!function_exists('glm_get_clientinfo_option')) { } } -function SearchFilter($query) { - if(isset($_GET['searchType'])) { - $searchType = $_GET['searchType']; - if ($searchType == 'blog' && !is_admin()) { - $query->set('post_type', 'post'); - } - } - return $query; -} -add_filter('pre_get_posts','SearchFilter'); - /** * glm_offcanvas_menu * @@ -215,19 +204,19 @@ add_action('init', 'mytheme_init', 10); function mytheme_search_loop() { while ( have_posts() ) : the_post(); ?> - +
- +
- + diff --git a/root/search.php b/root/search.php index e380968..12f2771 100644 --- a/root/search.php +++ b/root/search.php @@ -7,6 +7,7 @@
+ post_type=='page')) continue; ?>
- \ No newline at end of file + -- 2.17.1