Find posts by related taxonomy field

You’re meta querying on serialized data. I mean the artist from ‘key’ => ‘artist’ is serialized. That’s why your meta query hasn’t work. So here is my possible solution- $projects = get_posts(array( ‘post_type’ => ‘project’, ‘meta_query’ => array( array( ‘key’ => ‘artist’, // name of custom field ‘value’ => ‘”%’ . $artist->term_id . ‘%”‘, ‘compare’ … Read more

How to check specific value in two metabox?

You need to add the meta_compare argument to the meta query . Now your code will be like : ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘pb_responsible_home_person’, ‘value’ => $current_player_name, ‘compare’ => ‘=’ ), array( ‘key’ => ‘pb_responsible_away_person’, ‘value’ => $current_player_name, ‘compare’ => ‘=’ ), )// meta query end EDIT $current_player_name = get_post_meta( … Read more

Query by date from custom field

There is an argument meta_compare. Use it for comparison. $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘matches’, ‘meta_key’ => ‘date’, ‘meta_compare’ => ‘>’, ‘meta_value’ => ‘2016-11-12’, ‘type’ => ‘DATE’ );

Meta Query Based on Month Range

The problem is that you’re passing a meta VALUE in the key field of the meta_query…you should be passing your meta KEY there (“_wccf_pp_event_date”), as in: $seasons = array ( ‘spring’ => array (‘2017-03-21’, ‘2017-06-20’), ‘summer’ => array (‘2017-06-21’, ‘2017-09-20’), ‘fall’ => array (‘2017-09-21’, ‘2017-12-20’), ‘winter’ => array (‘2017-12-21’, ‘2018-03-20’), ) ; foreach ($seasons as … Read more

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