custom wp_dropdown_categories items in wordpress

You should be able to send the desired taxonomies as an argument to the function. This is untested, but should work: $args = array( ‘taxonomy’ => array( ‘galleries’, ‘places’ ) ); echo wp_dropdown_categories($args); For your reference, the function wp_dropdown_categories is defined in “wp-includes/category-template.php” on line 301. Take a look at it as it will help … Read more

Installing Solr for dedicated search

Make sure you use the solr port and hostname provided to you in your opensolr account area for your collection. The default free opensolr server, is running on port 8180. Every single aspect of connecting to the opensolr collections is being explain throughly, through the blog, and through videos. Opensolr is intended to give a … Read more

Creating a Search Array From Multiple Tables

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

remove post edit.php search form and replace with my own

The search form is here. It is part of the WP_List_Table class and is not replaceable as far as I can tell. However, you are talking about a livesearch which is necessarily Javascript. Carefully written Javascript should be able to hijack that form. You should not need to replace it.

Search Everything & WP 3.7 update issues [closed]

Thanks to @Pat J i removed the syntax that was causing me problems. For those who are interested, inside the Search Everything plugin, on line 198 – 221 there is the following function: function se_search_default() { global $wpdb; $n = ( isset( $this->query_instance->query_vars[‘exact’] ) && $this->query_instance->query_vars[‘exact’] ) ? ” : ‘%’; $search=””; $seperator=””; $terms = … Read more

How to conditionally pass a parameter to wordpress search to limit post types?

If you have a “natural” artwork archive (typically setting has_archive to true in your register_post_type() arguments), you already have the functionality in place: http://example.com/artwork/?s=query …assuming artwork is your archive slug, WordPress will search only artwork for “query”. Just set the action attribute of the search form to the archive URL, like so: <form action=”<?php echo … Read more

How to exclude events (custom posts) from search, if the start date has already passed?

This works, when I put it in functions.php. function wpq_modify_search( $q ) { if ( ! is_admin() && $q->is_main_query() && $q->is_search() ) { $meta_query = [ ‘relation’ => ‘or’, [ ‘key’ => ‘_event_start_date’, ‘value’ => current_time( ‘mysql’ ), ‘type’ => ‘DATETIME’, ‘compare’ => ‘>=’, ], [ ‘key’ => ‘_event_start_date’, ‘compare’ => ‘NOT EXISTS’, ], ]; … Read more