Including product categories (product_cat taxonomy) title and description in search query

Found out my solution by filtering the search query. Hope that helps: function new_search_join( $join ) { global $wpdb; if ( is_search() ) { $join .= ” INNER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id INNER JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id INNER JOIN {$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id”; } return $join; } add_filter(‘posts_join’, ‘new_search_join’ ); … Read more

WPML posts_joins on translated items

Finally able to find out a working solution. The inner join has to join term_taxonomy (where we find the term) to icl_translations with current language. And then from icl_translation to the origin language to get the element_id that then this element_id to term_relationships (where all the product from the origin product_cat are listed). If that … Read more

Loadmore search results not showing new results?

It seems you have hardcoded your pageNumber as 1 always. var pageNumbers = 1; So every time you click on “Load More” this value will be incrementing even if you are searching for new term. My approach would be to store the pageNumber value in “Load More” button. <button data-pageNumber=”1″ id=”load-more”>Load More</button> And when you … Read more

Modify WordPress Search

You could try something like this below. Basically, if we are performing a search and it is the main_query (the query that generates the page results) ignore the default search and perform an exact match via the query_where function custom_product_search_exact_match( $query ) { global $wpdb; if ( is_search() && is_main_query() && !empty( $query->query_vars[‘s’] ) ) … Read more

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