Support Forum

For all questions related to themes and plugins!

Enter search keyword e.g. "footer color".

  • Registration is Required

    Registration is required to post questions to support forum. ThemeForest buyers also need to obtain Purchase code to be able to post on forum.

    Please read here how to obtain Purchase code.

#1025
Robert Kavgić
Participant

Hello,

You can try and copy the code which shows the category list from the wp-content/themes/elvyre/cpt-portfolio.php.

Copy the part which starts at line 85 untill 120th line.

This should be the code:

<ul id="filters">                        
	<?php
	$category_html = '';
	$categories_count = 0;
	if (is_tax()) {
		$category_id = "";
		$query_category = $wp_query->get_queried_object();
		$category_id = $query_category->term_id;
		$args = array(
			'order' => 'ASC',
			'include' => $category_id
		);
	} else if (!empty($specific_taxonomies)) {
		$args = array(
			'include' => $specific_taxonomies,
			'order' => 'ASC'
		);
	} else {
		$args = array('order' => 'ASC');
	}

	$categories = get_terms('portfolio-category', $args);

	$index = 1;
	foreach ($categories as $cat) {
		$category_html .= '<li><a data-filter=".' . $cat->slug . '" href="#">' . $cat->name . '<span class="item-number">' . $cat->count . '</span></a></li>';
		$categories_count += $cat->count;
		$index++;
	}
	
	if (count($categories) > 1):
		?>
		<li class="active"><a href="#" data-filter="*"><?php _e('All', 'pi_framework') ?> <span class="item-number"><?php echo $categories_count ?></span></a></li>
	<?php endif; ?>
	<?php echo $category_html ?>
</ul>

You will need to style it as you wish and apply some css rules to it.

Let me know if it works…

Robert