To show categories in the portfolio item page template

Hi, I would like to know if it’s possible to show the category portfolio in the portfolio item template.

This is an automated message to notify you that your thread was posted in the wrong forum, and it has been moved to the correct place. A member of our team will be happy to reply just as soon as your thread is up. How support works.

For support, please post all questions in the Support Forum.

For peer to peer conversations with other Themeco customers about tips, customizations, or suggestions you are welcome to use the Conversation Forum (no official support provided here).

Design & Development, Marketing & Media, and Hosting & Optimization are for discussion with fellow Apex members about non Themeco related topics. Please keep this in mind in the future.

Thank-you!

Thanks for moving my post.

HI

I’m trying to figure out how to do this…by now my I’ve done the following:

1- To Use the child theme I’ve created a folder /framework/views/icon because I’m using icon
2- What I need to know now is the function and the usage to print the category/categories of the post
I know this one <?php x_portfolio_item_tags(); ?> show the tags, I’ve tryed with <?php x_portfolio_item_categories(); ?> but it seems it’s not correct

Anyone can help me?
Thank a lot

Hi There,

It is something like this:

			<?php 
			  if ( get_post_type() == 'x-portfolio' ) {
			    if ( has_term( '', 'portfolio-category', NULL ) ) {
			      $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
			      $separator         = ', ';
			      $categories_output = '';
			      foreach ( $categories as $category ) {
			        $categories_output .= $category->name . $separator;
			      }

			      $categories_list = sprintf( '<span>%s</span>',
			        trim( $categories_output, $separator )
			      );

			      echo $categories_list;
			    } else {
			      $categories_list = '';
			    }
			  }
			?>

Further customization from here would be getting on to custom development that is beyond the scope of our support. You may to consult a developer if you’re not comfortable doing the changes. Thank you for understanding.

Thank you very much!!

I’ll try with this

You’re most welcome.