Hello.
I have 2 portfolios (in Wordpress). One with 5 categories, and the other with 2 categories. However, with the code below, all categories are filterable on each portfolio, when really what I want is filters for category 1 to 5 for portfolio 1 and categories 6 & 7 for portfolio 2. I’ve pinpointed the code below in portfolio.php, but can’t seem to get it to work. Its either all filters or nothing!
To make it easier to understand, lets just call the categories:
category1
category2
category3
etc etc
<h2><a class=“catlink” href=“#filter=*” rel=“nofollow”>Show All</a>
<?php $categories = get_terms(“portfoliocategory”);
foreach ($categories as $category) {
$entrycategory = str_replace(‘,’,‘’,str_replace(‘.’,‘’,$category->name));
echo ‘<a class=“catlink” href="#filter=.’.$entrycategory .‘" rel=“nofollow”>’.$category->name.‘</a>’;
}
?>
</h2>
Thanks so much.