You have one or two issues here and possible future bugs that you might encounter
-
term
in yourtax_query
should beterms
-
Be carefull with terms having dates as names and especially dates as slugs. This can cause issues and unexpected results if custom permalinks clash or if something falls into the template hierarchy for some reason.
-
Never use the
name
field in atax_query
. There is an issue with the sanitizing of the term name before the join clause is constucted for the SQL query in theWP_Tax_Query
class. This is a known bug that will propably be there for many versions to come.I have explained the complete issue in this answer I have recently done, so feel free to go read the whole 9 yards. But in short, what basically happens is,
WP_Tax_Query
usessanitize_title_for_query
to sanitize the input from thename
field in atax_query
. This function strips all whitespaces and special characters and also convert all capitals to lowercase. So a term name likeMy Term Name/2
gets converted tomy-term_name2
which will fail as that term name does not exist.In short, as precaution, do not use the
name
field in atax_query
, rather useterm_id
orslug
. If you do not know these values, then useget_term_by()
to get the term ID or slug from the name and then pass that to thetax_query
-
You should also make sure that you can query posts from your custom taxonomy and custom post type publically. Make sure that have the correct values set when you register the post type and taxonomy