Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #539188

    How do I make the portfolio category display above the portfolio item, and also on the Portfolio web page that shows all the portfolio items in each category? Currently, the user has no indication of which portfolio category they are viewing.

    #540059

    Hi!

    1. There’s no built-in shortcode or element to show the category on single view but you can create one your own, paste the following code in your theme / child theme functions.php:

    function show_portfolio_category_func() {
    	global $post;
    	$the_terms = get_the_terms( $post->ID , 'portfolio_entries');
    	ob_start();
    
    	echo $the_terms[0]->name;
    
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('portfolio_category', 'show_portfolio_category_func');
    

    Then simply use [portfolio_category] on a Text Block within the portfolio item and that will render the portfolio category.

    2. On the portfolio listing page i think you’d need to create different grids for each category and set-up the grid for that (to show posts from that category only).

    Regards,
    Josue

    #542805

    Perfect. Thanks!!

    #542904

    Hi,

    Glad we could help :-)

    Regards,
    Rikard

    #581357

    Resolved.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Show Portfolio Category on Portfolio Pages’ is closed to new replies.