query posts – Need to add a space after meta value in query_posts in wordpress for zipcode search

Question

query_posts on wordpress has been trimming the last space of meta value added. on my case I need to add a space after zip code on the meta query

$meta_query[] = array(
                                array(
                                    'key' => 'address',
                                    'value' => $postcode,  // after postcode need to add a space
                                    'compare' => 'LIKE',
                                ),
                            );

But the last space is trimmed by wordpress . Is there any way to add a space after the postcode value. I have seen the same issue here WP_Query meta_query where meta value ends in space

But it’s not working for me

0
Amal 3 weeks 2021-09-07T00:35:52-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse