Multi-step, live updating search

It sounds like you need conditional form fields for selecting your criteria based on previous criteria selection, then for live filtering, you would use an ajax filter instead of the regular form submit. I assume you are filtering WordPress posts. If you search for “conditional form fields” and “wordpress ajax filter” you should find lots … Read more

Search options/filters

First things first: the name attribute for your “All Words” checkbox shouldn’t be ‘s’. That replaces the search text with “1”, so when that’s checked, you’re searching for “1”, not for the search text. I don’t think you want to use ‘exact’ if you’re looking to replicate the example you gave in your question. Here’s … Read more

Putting Text in the Search Box. eg- “Search My Site” [closed]

From the Codex Docs: The is_search() Conditional Tag checks if search result page archive is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE. <?php $search_box_term = is_search() ? get_search_query() : ‘DEFAULT SEARCHBOX STRING’; ?> <input type=”text” value=”<?php echo $search_box_term; ?>” name=”s”> So this ↑ shows either DEFAULT SEARCHBOX STRING … Read more

Incude comments in search

Whether you put custom code in your theme’s functions.php or in a plugin, you’re still using custom code. So I’m going to ignore your “without a plugin” requirement and instead suggest these two plugins: Search Everything Relevanssi There is absolutely no reason to use custom functionality in functions.php rather than a plugin. When you’re asking … Read more

Dave’s WordPress Live Search only works when logged in as admin

That plugin uses the AJAX API as it should… http://frome.fm/wp-admin/admin-ajax.php?s=ho&action=dwls_search … but when not logged in that request fails (from HttpFox)… 07:23:58.923 0.155 470 0 GET (Aborted) NS_BINDING_ABORTED http://frome.fm/wp-admin/admin-ajax.php?s=ho&action=dwls_search Since you say that the plugin works when you are logged in the Ajax callback is likely hooked to wp_ajax_* but not wp_ajax_nopriv_* The latter is … Read more

Eliminate duplicates in a foreach loop [closed]

Use array_unique() <?php foreach($users as $user) { $states[] = get_cimyFieldValue($user->ID, ‘STATE’); // Grabing their state from their profile page } $states = array_unique($states); ?> <div class=”state”> <input type=”hidden” name=”search_type” value=”members”> <select id=”stateDrop” name=”state”> <option value=”name”>State</option> <?php foreach($states as $state) { echo ‘<option value=”‘.$state.'”>’.$state.'</option>’; } ?> </select> </div>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)