Category in Single Portfolio Page

This topic is: Not resolved

This is a PRIVATE forum for verified users only, to view the replies/answers, you must be logged in!

This topic contains 6 replies, has 3 voices, and was last updated by  wpthms 2 years, 6 months ago.

  • Author
    Posts
  • #2477

    medienbauer
    Member
    Post count: 6

    Hello, i want do display the portfolio category in the single portfolio site.

    I use the following code.

    <?php echo $the_category;?>

    but nothings works?

    do you have the right code ?

  • #2483

    medienbauer
    Member
    Post count: 6

    hellop, i need info for this case!!!!

  • #2486

    medienbauer
    Member
    Post count: 6

    hello, i put this code in the single-portfolio template

    <?php
    $terms = get_the_terms( $post->ID, '<strong>portfolio-type</strong>' );
    						
    if ( $terms && ! is_wp_error( $terms ) ) : 
    
    	$draught_links = array();
    
    	foreach ( $terms as $term ) {
    		$draught_links[] = $term->name;
    	}
    						
    	$on_draught = join( ", ", $draught_links );
    ?>
    
    <p class="beers draught">
    	On draught: <span><?php echo $on_draught; ?></span>
    </p>
    
    <?php endif; ?>

    BUT NOTHING WORKS!!!

  • #2489

    Max
    Staff
    Post count: 3150

    Hey there, You must be logged in to view this reply!

    Login | Register | Forgot Password?

  • #2496

    medienbauer
    Member
    Post count: 6

    TOP!

  • #2498

    wpthms
    Staff
    Post count: 260

    Hey there, You must be logged in to view this reply!

    Login | Register | Forgot Password?

  • #2484

    Max
    Staff
    Post count: 3150

    Hey there, You must be logged in to view this reply!

    Login | Register | Forgot Password?

You must be logged in to reply to this topic.

This is a PRIVATE forum for verified users only, to view the replies/answers, you must be logged in!