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
- Jquery implementation not working on page reload
- Multisite Ajax serialize return error [object Object]
- Unique sequential reservation code
- Create post using Ajax
- Usage of theme name in functions
- How to disable controls in theme customizer?
- Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)
- paginate_links() don’t properly work in search.php?
- Functions.php Problem
- WordPress listen to $_POST in functions.php
- ACF not showing
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Load Post into DIV with Ajax
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- AJAX error handling for submit function in functions file
- Control the srcset much more (not all sizes in it each time)
- Check if the image size is available and if not use ‘full’ image size
- Way to store featured image width and height in two separate variables?
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- echo custom fields with AJAX
- Define PHP variable from a seperate API if statement
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Excerpt for pages not showing
- get_pages() Returns Only One Item
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Include the post type before the title of search results
- Does size of a theme’s functions.php file matter?
- Functions php shortcode for displaying main menu with no child items
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- How to rewrite wordpress search to work on specific category
- Check if a value exists in database table
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- processing form data with ajax
- Getting the teaser text without overriding global variables
- Combine two active_callbacks into one on theme customizer
- 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 store a number (coming from cookie) into query vars for later usage in other filters?
- Email Exists ERROR into Ajax registration form
- Is this an acceptable practice for WordPress theme development?
- 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?
- What is the correct way to include my new functions and scripts in WordPress?
- two search forms on the same page
- wp_nav_menu work in functions.php but not in the theme
- Ajax resetting my global variable
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- search form leads to 404
- 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?
- get content from page through AJAX
- Custom function for search form
- Get URLs for AJAX Filter Checkboxes WordPress
- Message notification for user
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- WordPress: Highlight search result exact matches
- Detect Ajax call inside pre_get_posts function
- How to fix Function create_function() is deprecated in / themes
- Exclude specific post from query
- Advanced method to control cache of enqueued style/script
- WordPress wp_dequeue_script remove all other scripts
- Populate Product Regular Price with a calculated ACF Field Value
- Ajax Form Issues using Lightsail (AWS)
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- post value to function with Ajax and jQuery
- Is_Page doesnt detect my page
- price of product can’t return when get data of product in functions.php
- WP AJAX Request Not Working
- Test CDN link from function.php or wp_enqueue_script/style?
- How to customize archive widget only for cpt?
- Ajax in plugin fails – but only on one blog – no idea why
- wp_title() return random number
- Limiting WordPress Search function : Custom build
- Why does echo on functions.php not yield result in source code?
- How to offset main query without affecting other queries and backend
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- 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
- Multiple Notifications SetInterval
- Function stops working
- admin-ajax.php 403 forbidden only when calling from external file
- More than one search results page template for two searches on site
- How do i create a search option for pdf’s only
- WordPress Ajaxifying not working properly
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to retrieve image IDs from shortcode content?