Created
July 22, 2017 07:06
-
-
Save holyPickleNick/d5c998b0360b6425baa11b59b9c57e6a to your computer and use it in GitHub Desktop.
WordPress Advanced Search
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 | |
function advanced_search_query($query) { | |
//var_dump( $query ); | |
if( is_home() && ( isset( $_GET['category_name']) || isset( $_GET['search']) ) ) { | |
error_log( 'woooooo'); | |
// tag search | |
// if (isset($_GET['taglist']) && is_array($_GET['taglist'])) { | |
$query->set('tag', 'river'); | |
// } | |
return $query; | |
} | |
} | |
add_action('pre_get_posts', 'advanced_search_query', 1000); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment