Hot answers tagged

3

I am assuming your custom post type is also "series". Can you try this, it should work. $args = [ 'post_type' => 'series', 'posts_per_page' => -1, 'meta_query' => [ [ 'key' => 'series', 'value' => 19, 'compare' => '=', 'type'=>'NUMERIC' ] ...


1

I think you need to do something like this: <?php $args = array( 'post_type' => 'shop', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'cu_status', 'value' => array( ...


1

If I get it right you are storing this data in user meta. WP_Query would have no remote idea how to retrieve that, since it's only aware of post meta. The two are completely separate and there is no native way to involve one in queries for another. Likely you will have to do this in a two step process: Use get_users() to retrieve IDs for all authors of ...


1

You're doing something like this tutorial on categorizing wordpress users, correct? I think you should do your filtering in your theme files, not on a hook. Just add an if statement to your template file (probably author.php) that tests if your custom fields aren't empty strings, and then do whatever (404, redirect elsewhere, throw a notice...) Unless you ...


1

Fields in database tables can not contain other types of data than text strings and numbers, and variations of them like dates and times. The field meta_value of wp_postmeta is a text field. So, when you store an array as meta_value you are really storing a string containing the serialized data that represents the original array. If you need to interpret ...



Only top voted, non community-wiki answers of a minimum length are eligible