Grouping posts by 2 different taxonomies

After much searching, and lots of help here (thanks again, Sally CJ), this the code I ended up using. $category_terms = get_terms(array(‘taxonomy’ => ‘categories’)); $series_terms = get_terms(array(‘taxonomy’ => ‘series’)); $custom_post_type=”cpt”; foreach( $category_terms as $category_term ) { foreach ($series_terms as $series_term) { $args = array( ‘post_type’ => $custom_post_type, ‘showposts’ => ‘5000’, ‘meta_key’ => ‘available_date’, ‘tax_query’ => … Read more

Why does ‘get_the_ID’ work outside of the loop?

The get_the_ID() function uses the global $post variable, which outside of the loop is sometimes equal to get_queried_object_id(). Within the loop, the $post variable is set to the current post within the loop. As to why get_queried_object_id() is recommended outside of the loop, is because it does not use the global $post variable, so is … Read more

error code: 523