It seems to me that you have not changed the operator in the function attached to the get_meta_sql
filter.
If $search_string
is only fragment of the title, you should change post_title="%s"
in code from this answer to:
$sql['where'] = sprintf(" AND ( %s OR %s ) ",
// --- post title begins with the searched phrase --
$wpdb->prepare( "{$wpdb->posts}.post_title LIKE '%s'", $title . '%' ),
// -- OR post title contains the searched phrase --
// $wpdb->prepare( "{$wpdb->posts}.post_title LIKE '%s'", '%'. $title . '%' ),
mb_substr( $sql['where'], 5, mb_strlen( $sql['where'] ) )
);
Related Posts:
- Search user metadata with checkboxes via ajax (almost working)
- admin-ajax.php + load-scripts.php hanging for minutes
- PHP 7.1 | Warning: A non-numeric value encountered in
- contact form in template with jquery,validate and ajax
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to create admin ajax function for my contact form
- Ajax call always returns 0
- Issues with title-tag and document_title_parts
- Is it ok to use a function to output the text domain name in a wordpress theme
- How to redirect to post if search results only returns one post
- Possible to search by author name with default WordPress search function?
- TinyMCE custom styles remove class when switching styles
- Extending the site search to include a single custom field
- wp_get_attachment_image returns different image size
- ajax live search for post title
- Modify search function in WordPress (TwentyTwelve)
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- Overriding core functions in child theme
- Display random text from a file with the WP built-in AJAX API
- Change parent theme file function in child themes functions.php
- Dequeue Scripts and Style for Mobile not working?
- Using email_exists() wp function in an ajax request
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- Displaying Widgets
- Display a function using AJAX
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Unable to get_the_content(); of a post in WordPress via AJAX
- How can I customize wp_footer, where is the code that controls what this function does?
- Best Practice for Syncing Local Development With Staging Development [closed]
- Overwrite Parent Theme add_image_size in Child Theme
- Ajax call theme functions from front
- Show excerpt for only first post in query
- How to add css class to image attached in all the posts?
- Searching for content post
- Is there a way to add a class to non current menu item?
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- Custom Taxonomy Tag Search
- ‘is’ functions and ‘get_query_var’ not working
- How to use Internationalized human_time_diff() function in Chinese?
- is_dynamic_sidebar always returns true while using Jetpack visibility
- Ajax not working properly
- Add caption functionality to custom WordPress theme
- Override a theme function in a child theme?
- changing behaviour of get_search_form
- Pulling Twitter RSS feed not working as expected (fatal error)
- Use register_setting() in a loop
- WP Ajax Function Always Returning undefined
- Scripts not appending to element in AJAX call – why?
- Add dynamic links in WordPress custom theme
- WordPress menu link doesn’t work properly
- How to search using ajax for exact phrase or words in an input field?
- Unique sequential reservation code
- How to disable controls in theme customizer?
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Control the srcset much more (not all sizes in it each time)
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Include the post type before the title of search results
- Functions php shortcode for displaying main menu with no child items
- Check if a value exists in database table
- WP Customizer API loaded into functions.php
- call_user_func_array() expects parameter 1 to be a valid callback, function
- why can’t i add front.css to my frontpage.php
- “options.php” not found
- How to use get_posts() function in functions.php
- Is there a hack for using is_page() within the function.php file?
- Are innerHTML elements visible to jQuery functions?
- two search forms on the same page
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Message notification for user
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- Advanced method to control cache of enqueued style/script
- Populate Product Regular Price with a calculated ACF Field Value
- Is_Page doesnt detect my page
- Test CDN link from function.php or wp_enqueue_script/style?
- How to customize archive widget only for cpt?
- Why does echo on functions.php not yield result in source code?
- How to use `foreach()` in ajax call
- Add meta data in head from theme
- what is `get_section()` and how to use it?
- i can’t use wordpress functions in ajax loaded php file
- WordPress Ajaxifying not working properly
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- Load scripts into an AJAX div
- same get_posts function works diffrently in tag.php and functions.php
- Automatic add space if user enters number(any digit)
- functions.php filters not applied in AJAX call
- Pass max posts to Javascript
- wp_nav_walker that interacts with widgets to setup mega menu
- Make WordPress search for only this tags or exclude certain tags from search [duplicate]
- Allow tags and attributes in post and pages content
- admin-ajax.php nulls all php variables
- child_of not working while searching
- Syntax for a function in order to get post’s title in JSON encoded response [closed]
- Why wp_ajax hooks doesn’t work?
- Why functions metaboxes is causing White Screen in Admin [closed]
- Getting error on function.php
- How can I json_encode the output of my function?