Hide Search Form above results

You can find the search form in the “search.php” file. Comment out or delete the code that looks like this one: <header class=”page-header”> <h1 class=”page-title”> <?php _e( ‘Search results for:’, ‘twentynineteen’ ); ?> </h1> <div class=”page-description”><?php echo get_search_query(); ?></div> If you are using a child theme and there is no “search.php” file, then copy the … Read more

WordPress Search by tags

You can install WordPress Extended Search https://wordpress.org/plugins/wp-extended-search/ It adds a settings page to the basic WordPress settings. From there you can turn off everything apart from searching by tags.

How to search through “post title” and “tags” using WP_Query?

Try getting rid of the “0” key in your tax_query and meta_query array. $query_args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘order’ => ‘ASC’, ‘orderby’ => ‘none’, ‘posts_per_page’ => ‘100’, ‘offset’ => ‘2’, ‘page’ => ‘2’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_tag’, ‘field’ => ‘name’, ‘terms’ => array(‘test’), ‘operator’ => ‘IN’, ), ‘relation’ … Read more

search based on custom field

Add these filters to your functions.php file /** * Join posts and postmeta tables * * @link https://developer.wordpress.org/reference/hooks/posts_join/ */ add_filter( ‘posts_join’, function( string $sql, WP_Query $query ) { global $wpdb; if ( !is_admin() && $query->get( ‘search_meta’ ) ) { $sql .= ‘ LEFT JOIN ‘ . $wpdb->postmeta . ‘ ON ‘ . $wpdb->posts . ‘.ID … Read more

Search issue on special Character

By copying and pasting each dash into a Unicode lookup (linked below), you can see the two characters are different. Your first string contains an En Dash, which is a different character value than the second string, which is a Hyphen Minus. When performing a search, WordPress is searching for the Em Dash value in … Read more

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