Search Everything plugin integration
Search Everything doesn’t modify the search form, it only modifies the queries a search performs. You won’t see any changes on the front end except within the contents of the search results.
Search Everything doesn’t modify the search form, it only modifies the queries a search performs. You won’t see any changes on the front end except within the contents of the search results.
You’ve got the right idea. If you get an array of country IDs within a region, you can pass that array to a meta query IN comparison: $country_ids = array(1,2,3); // this would be the result from fetching countries associated with a region. $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => … Read more
It’s easy. Just add this hook for template_redirect action and it will redirect your search queries to nice url: function wpse8170_search_url_redirect() { if ( is_search() && !empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/something/” . urlencode( get_query_var( ‘s’ ) ) ) ); exit; } } add_action( ‘template_redirect’, ‘wpse8170_search_url_redirect’ ); Add to your .htaccess file: # … Read more
it seems Relevanssi is a very good updated plugin it solved my problems
Not sure it is a smart thing* to do but it is possible. The easy solution is to check if you have any posts and if not redirect based on the referer At the top of your code (before the call to get_header) add if ( !have_posts() ) { if (isset($_SERVER[‘HTTP_REFERER’])) { wp_redirect(301,$_SERVER[‘HTTP_REFERER’]); } } … Read more
Now, is it possible to check if page is the search page is_search() AND what’s the search string is_search() AND print get_query_var( ‘s’ ) AND how many posts were found? is_search() AND print $GLOBALS[‘wp_query’]->number_posts() … or if you got a custom query… $my_query = new WP_Query( array( /* whatever args */ ) ); is_search() AND … Read more
What kind of control do you want exactly? There are, for example, plugins that provide a UI through which you can order posts by various parameters. If you just want to order them all by one parameter that will not change, you can simply add it to your query (since you can order by multiple … Read more
This is what i did: I run another query without pagination like this: $newQuaryVars=”&posts_per_page=99999999999999&post_type=post”; $posts = query_posts($query_string .$newQuaryVars); $categoriesList = array(); $categoriesAmounts = array(); Then in the while have posts i did the following: while ( have_posts() ) : the_post(); $postCategories = get_the_category(); if($postCategories){ foreach($postCategories as $categoryInfo) { $categoriesAmounts[$categoryInfo->term_id][‘amount’]++; $categoriesList[$categoryInfo->term_id] = array( ‘name’ => $categoryInfo->name, … Read more
Because you want the results of the filtering process be the main object of your page, you may need to alter the main query using pre_get_posts action hook. It is really better that leave the main query run, load your theme and then say to WordPress: go back and run another query as suggested in … Read more
Right, seems a little empty here but I figured out the problem myself, again. The trick was to have empty values in the $output variables. So $output .=”<option value=””>Select taxonomy #1</option>”; NOT $output .=”<option value=”#”>Select taxonomy #1</option>”; This is how you can create two dropdown menus and filter out your posts using your custom taxonomies. … Read more