Automatically Give All Custom Post Types a Pre-Set Category [duplicate]

You can force default terms for a post by using the save_post hook. Here’s an example from the Developer resources originallly by the user Aurovrata Venet. add_action( ‘save_post’, ‘set_post_default_category’, 10,3 ); function set_post_default_category( $post_id, $post, $update ) { // Only want to set if this is a new post! if ( $update ){ return; } … Read more

WP_Query inside foreach loop returning same value for all options when filtered using ajax

If anyone is interested in how to achieve the result for the question I posted, I managed to work it out! As the correct results we’re being displayed, but for each iteration of the foreach loop rather than the specific day, I managed to get the results to display/hide by using if (is_object_in_term($class->ID, ‘calendar-day’, ‘monday’) … Read more