Create custom query for search?

Have you check your result-set, what result you are getting in $query obj. another thing, there is no need to use ‘relation’ => ‘OR’, in meta query array, have a try with this as well. And instead of ‘numberposts’ use ‘posts_per_page’ this will help. 🙂 or you can remove the meta_query and make your $arg … Read more

Filter posts/pages by user_role array

You’ve used LIKE comparison method, that means every similar expression will be matched, including exact string and similar string. If you want to match exact string, you should use = operator. Example: global $current_user; $user_roles = $current_user->roles; $user_role_query = array(); for ($i=0; $i < sizeof($user_roles); $i++) { $user_role_query[] = array( ‘key’=>’attribution_roles’, ‘value’ => $user_roles[$i], ‘compare’=>’=’ … Read more

meta_query not working with the_content()

the_content() echoes data to the page so essentially your query looks like: ‘meta_query’ => array( array( ‘key’ => ”, ‘value’ => $related_venue_variable, ‘compare’ => ‘==’ ) ) You want get_the_content() to return a string that you can pass along through the query. However, having the post content as a meta key doesn’t make any sense. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)