Custom post type search only title WP_query and title capital and small latter issue - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Saturday, July 29, 2023

Custom post type search only title WP_query and title capital and small latter issue

Post title: "Test"

when i am searching "test" then autosuggestion not showing result but when search First word Capital "Test" then autosuggestion showing.

How to solve it?

Please response Thank You

$results = new WP_Query( array(
                'post_type'     => array( 'dream'),
                'post_status'   => 'publish',
                'posts_per_page'=> 221,
                's' => stripslashes($_POST['search'])
                //'s' => $search_key,
                //'title'     => 'true',
            ));
            $items = array();
            if ($results->have_posts()) {
                while ( $results->have_posts() ) : $results->the_post();                
                    $items[] = get_the_title();  
               endwhile;
            }


source https://stackoverflow.com/questions/76789797/custom-post-type-search-only-title-wp-query-and-title-capital-and-small-latter-i

No comments:

Post a Comment