Excluding a specific category in a photo gallery
-
Hi there,
I am working with a Wp theme on a site and I am having a problem excluding categories from the photo gallery. This is the work in progress site. I am trying to exclude 2-3 categories from the catch all part of the photo gallery under the ‘shop’ nav. For example I want to exclude the colors from the shop but still allow them to show up under the ‘colors’ tab.
I am thinking it is somewhere in the bit of code below. I have been searching everywhere and tried a few things but I am not very savvy at php. Any insight would be awesome.
<?php //get portfolio categories $cats = get_terms('portfolio_cats'); //show filter if categories exist if($cats[1] !='') { ?> <!-- Portfolio Filter --> <ul class="filter clearfix"> <li class="sort"><?php _e('Sort Items','workz'); ?>: <li class="cat-item active"><a href="#all"><span><?php _e('All', 'workz'); ?></span></a> <?php foreach ($cats as $cat ) : ?> <li class="cat-item"><a>slug; ?>" class="<?php echo $cat->slug; ?>"><span><?php echo $cat->name; ?></span></a> <?php endforeach; ?> <?php } ?>
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code has been permanently damaged/corrupted by the forum’s parser.]
- The topic ‘Excluding a specific category in a photo gallery’ is closed to new replies.