wordpress ajax relationship query

Look at the very last part of that query– LIKE ‘%\”17497\”%’. You are searching for any characters, followed by literally “17497”, followed by any characters. I am pretty sure that is not what you want. I think you want any characters, followed by 17497 without the quotes, followed by any characters. That means the meta_query … Read more

Replacing raw database query to WP_Query

Finally found the answer. Since I had not specified ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘_recommended’, The limit was being considered as count. I am not sure if am explaining this right