Hey there & merry Christmas Experts :-),
if want to have the following Scenario: Custom Post Type "Portfolio" with Tags (Filters) and Categories (Portfolio Groups)
Let's say a 1. Webdesign Category with Tags (for Filters) PHP, HTML, CSS 2. Photography Category with Tags (for Filters) Animals, Landscape
Now I can choose in the Backend from a Metabox from which Category/Categories I want to show the Portfolio. (That's what I have so far)
I Struggle with the Frontend: In the Frontend I now have to Pull the Tag-List from the chosen Portfolio Categories.
Then Pull the entries (title, permalink, ...) from the chosen Categories and display the appropriate tags.
Custom Post Type is called: portfolio Portfolio Tags called: portfolio_tag Portfolio Categories called: portfolio_category
That's what I have so far: Tags don't get pulled by selected categories, instead from all categories :/....
<div id="filters">
<ul>
<?php $tags = get_categories('taxonomy=portfolio_tag&title_li=');
foreach ($tags as $tag){ ?>
<li><a href="#" data-filter=".term-<?php echo $tag->name;?>" title="<?php echo $tag->count;?> <?php _e('Items', 'minti'); ?> "><?php echo $tag->name;?></a></li>
<?php } ?>
</ul>
</div>
// Array of selected categories:
// wp_get_object_terms( get_the_ID(), 'portfolio_category'
I'm searching for the easiest, cleanest way to do this and I'm a PHP noobie :-)
Hope you can help me out. Thanks
register_taxonomy()? – toscho♦ Dec 25 '12 at 11:19