WP Query search for attachments and their exact title

Try something like that The reverse of this: https://wordpress.stackexchange.com/a/209714/180599 <?php global $wpdb; //The reverse of this: https://wordpress.stackexchange.com/a/209714/180599 $supported_mimes = array( ‘image/jpeg’, ‘image/gif’, ‘image/png’, ‘image/bmp’, ‘image/tiff’, ‘image/x-icon’ ); $all_mimes = get_allowed_mime_types(); $accepted_mimes = array_diff($supported_mimes, $all_mimes); //and… $keyword = stripslashes($_REQUEST[‘keyword’]); //$search = $wpdb->get_col( $wpdb->prepare( ” SELECT DISTINCT ID FROM {$wpdb->posts} WHERE post_title=”%s” OR post_content=”%s” “, $keyword, $keyword … Read more

Where do custom menus get constructed?

Try this: add_filter(‘wp_nav_menu_items’,’search_box_function’); function search_box_function { search box code goes here } For reference, check out Bill Erickson’s excellent tutorial on accomplishing this with the Genesis framework.

how to search in custom fields & custom taxonomy for custom search

Managed to figure it out by adapting that code from the link i posted: function atom_search_where($where){ global $wpdb; if($_SESSION[‘js’] != ”) $where .= “OR (t.name LIKE ‘%”.trim($_SESSION[‘js’]).”%’ AND {$wpdb- >posts}.post_status=”publish”)”; $where .= “OR ($wpdb->postmeta.meta_key = ‘_job_ref’ AND $wpdb->postmeta.meta_value=””.$_SESSION[“js’].”‘)”; return $where; } function atom_search_join($join){ global $wpdb; if($_SESSION[‘js’] != ”) $join .= “LEFT JOIN {$wpdb->term_relationships} tr ON … Read more