Grab posts by multiple categories

You should be able to use this: if (isset($meta_field[‘category’])) { // Get all post data for that category $post_data = get_posts_by_category($meta_field[‘category’], 0, $post_limit); } else { $args = array( ‘numberposts’ => $post_limit, ‘offset’=> 1, ‘category’ => ‘9,3’, ); $post_data = get_posts($args); }

How to use terms from the same custom taxonomy in different roles in a custom post type?

You could create two custom meta fields for your custom post type ‘letter’. With the plugin Advanced Custom Fields, this can be done in a minute: https://www.advancedcustomfields.com/resources/taxonomy/ With one field you choose your sender, with the other you chooce your receiver. You can also create your fields by hand, but even the wordpress docs tell … Read more