the_terms()

This WordPress function requires the CPT-onomy class.

Description

Prints the terms of a CPT-onomy in a list.

Usage

$cpt_onomy->the_terms( 						int
						$post_id
						, 						string
						$cpt_onomy
						, 						string
						$before
						, 						string
						$separator
						, 						string
						$after
						 );

Parameters

$post_id (integer) (required)
Default: none
The post's ID.

$cpt_onomy (string) (required)
Default: none
Name of the CPT-onomy to retrieve terms from.

$before (string) (optional)
Default: none
Text to display before the actual terms are displayed. The default is to display nothing.

$separator (string) (optional)
Default: none
Text or character to display between each term link. The default is a comma (,) between each term.

$after (string) (optional)
Default: none
Text to display after the last term. The default is to display nothing.

Examples

<?php

global $cpt_onomy;
$cpt_onomy->the_terms( $post->ID, 'actors', 'Actors: ', ' / ', '' );

?>

WordPress Codex

For more information, refer to the WordPress codex.