Changing the ORDER BY in WordPress default search function

If I were you, I would likely use the posts_search_orderby hook to change the search ORDER BY clause, because that way, the sorting would work with pagination. So for example in your case, you would want to sort by the post type like so: (well, if the “product posts” is of a different post type?) … Read more

Changing default wp search string

By default WordPress use a + between spaces No, it doesn’t. WordPress doesn’t generate + characters, it doesn’t use those characters, and it can’t see them. So Where Does the + Come From? The browser and URLs. Spaces in URL parameters are encoded as + characters or %20. Forms specifically become +. When data that … Read more

Custom search Dashboard widget

Firstly, let’s start off by cleaning up the query you have above. I’ve put it into Heredoc syntax to make it easier to read. $sql = <<<SQL SELECT * FROM {$tablename} — you should use interpolation when working in a string that can have variables WHERE ( — Your query will only ever match one … Read more

Should I create a parent page with no content? [closed]

Your question is a bit out of the scope of this site, but according to Google, creating any URL without content would not be beneficial for SEO. It would likely work better SEO-wise to create a custom post type that has no archive, so you have the parent slug you’re wanting in the URL without … Read more

Search function does not work on mobile devices

In WordPress the name for a search field must be s. WordPress automatically performs a search on any request where s is present. For some reason your theme has a separate search field named m that is displayed on mobile. This won’t do anything unless custom code is added to handle this. But that’s not … Read more

Include results with tags relevant to the search keyword with JSON rest API v2

WP Extended Search does not work with REST by default since version 2.0.2 This is to achieve maximum compatibility with WordPress and other plugin/themes. To enable the support, pass wpessid in REST request with ID (for specific search setting) or without ID (for global search setting). e.g. /wp-json/wp/v2/posts?search=technology&wpessid or /wp-json/wp/v2/posts?search=technology&wpessid=10 Ref: https://wordpress.org/support/topic/search-queries-with-metakey-name-issue-version-2-0-2/#post-14376988 PS:- I am … Read more

Intelligent Search Filtering

The problem with custom fields is that there is no relation between them so you can’t relate Suburbs to cities. A better way would be to create an hierarchical Custom Taxonomy so you can have a parent – child relation (like categories and sub categories). so: add_action( ‘init’, ‘create_locations_taxonomies’, 0 ); //create two taxonomies, genres … Read more

BuddyPress – Search members by name and also by username

Somebody on the BuddyPress support forums had this to say: I don’t recommend to change the core files of buddypress. The best way to do it is to write a custom code (I don’t know how to guide you). So if you don’t mind changing the core files, here is a quick way. Open /buddypress/bp-core/bp-core-classes.php … Read more

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