Portfolio content filters

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.

A bit more info as to how I ended up in this position…

Basically the portfolio & filters for the theme I have work fine. But I had too many categories, so decided to split the portfolios into two separate ones.

Because of this, the two portfolios originally included exactly the same content, but I was able to include / exclude certain categories so that categories 1-5 are shown in portfolio 1 and categories 6&7 in portfolio 2.

So far, so good.

The filter allows the user to select “category1” and only portfolio items registered to that category will show. However, the filter on both portfolios shows all categories, when I don’t want it too. The code above (in my original post) is definitely the right area.

Any help available would be much appreciated. My web deadline is tomorrow :frowning: