Function using get_posts() with tax_query not working when called from functions.php
For testing purposes in your functions.php file, try this – add_action(‘init’, ‘my_test_get_all_bands’, 99); function my_test_get_all_bands(){ echo ‘<pre>’; print_r(get_all_bands()); echo ‘<pre>’; } As I was attempting to say in my comment to your question (and as Pieter Goosen explained rather better), if your taxonomies have not yet been registered then the tax_query portion of your get_all_bands() … Read more