Enable taxonomies by post type in an array of CPTs

I have tweaked theyour code and it should work.. please give it a try add_action(‘init’, ‘all_custom_post_types’); function all_custom_post_types() { $types = array( array(‘the_type’ => ‘event’, ‘single’ => ‘Event’, ‘plural’ => ‘Events’ ), array(‘the_type’ => ‘resource’, ‘single’ => ‘Resource’, ‘plural’ => ‘Resources’ ), array(‘the_type’ => ‘team’, ‘single’ => ‘Team’, ‘plural’ => ‘Team’ ), ); foreach ($types … Read more

Query multiple taxonomies with pre get posts

I can’t seem to find a way to set the query more than one taxonomy You already found it, but the problem is, you should have not done this: $tax_query_array = array(‘relation’ => ‘OR’); $speciality_select ? array_push($tax_query_array, …) : null ; $query->set( ‘tax_query’, $tax_query_array); $tax_query_array = array(‘relation’ => ‘OR’); $industry_select ? array_push($tax_query_array, …) : null … Read more

Creating tags via API

Hi @James: If you have the post ID of your newly created post (the $created variable from your question) you use the wp_set_object_terms() function, for example: wp_add_post_tags($created,’My First Tag’); wp_add_post_tags($created,’My Second Tag’); wp_add_post_tags($created,’My Third Tag’);

Custom query for custom post_type

change your query a bit: $todays_date = time(); $args = array (‘post_type’ => ‘tasks’, ‘meta_key’ => ”end_date, ‘meta_compare’ => ‘<‘, ‘meta_value’ => $todays_date, ‘orderby’ => ‘meta_value’ ); $tasks = get_posts($args); and then for each one of this posts get the start_date meta and compare with $today something like: $today = strtotime($today); foreach ($tasks as $task_post){ … Read more