Making a list of post tags in string

You’re using get_the_tags() incorrectly. It does not return an array of tag names. It returns an array of tag objects. Each tag object does contain the tag’s name (along with other data), but you can’t use implode() on that result. I used your original code just adding a step to put the tag object’s name … Read more

How to change users smart quotes to dumb quotes in search bar?

Try this. It’s a function that will filter the search query and replace any smart quotes with their “dumb” equivalent. <?php /** * Filter smart quotes out of a search query. * Replace them with “dumb” quotes. * * @param WP_Query $query Instance of WP_Query. */ function filter_search_smart_quotes( $query ) { if ( $query->is_search() ) … Read more

intellisense in wp search

So you want more general autocomplete, rather than something specific (like blog tags for example)? If you use (or will consider using) Google Custom Search (which is very popular option to replace native WP search), they made it quite easy to enable native autocomplete with it. See: Autocompletion of queries in Custom Search Control over … Read more

Display title for search engine visitors

I just ran a test on my hosted dev site. I ran the following: echo ‘<pre>’; global $wpdb; print_r($wpdb); print_r($GLOBALS); echo ‘</pre>’; There was no ‘wp_query’, ‘[q]’, or ‘search’ variables to be found. Note that I was not able to search this through a search engine as it’s not web accessible. Just to give you … Read more

Changing the search URL?

You can change the /search/ part to something else, like /topic/, but it will be harder to remove it completely, since that will conflict with WordPress Pages (is /banana/ a Page with the title “Banana” or is it the result page for the search term “Banana”?). To change the part, hook into the init action … Read more

Creating a better multi-site search experience

There is actually an existing tool called Sitewide Tags that takes care of this. Essentially, it creates an extra hidden site on your network and mirrors content from each of your other sites on it. Then, when you search, you search against the hidden site and get links back to the original content location. I’ve … Read more