This question is a little different then the others floating around here. The most similar one is "How to get the parent's taxonomy ?".
I have a music cms setup that utilizes two post types: album and album media and a few taxonomies: genre, year, and artist. In the footer of every single-album.php post I want to display the corresponding album media template and do this dynamically. There is only one album media post for every one album.
Both post types are associated with the three taxonomies. How can I write a loop inside another loop that automatically/dynamically obtains the associated taxonomies of it's parent post type?
For example: An album called "Dark Side of the Moon" is associated with taxonomies rock, 1973, and Pink Floyd. The album media "Dark Side of the Moon" is associated with the same taxonomies.
Within the main loop in single-album.php is another loop that looks for what three taxonomies the album is associated with and constructs a loop for "album-media". The contents of this loop could also be displayed as single-albummedia.php.
Can this be done? I have the feeling that I am over-thinking this :)
Things this question involves:
- multiple taxonomy query
- loop within a loop
- custom taxonomies and post types