我正在打印艺术家自定义分类的描述,代码如下:
$terms = get_the_terms( $post->ID, \'artists\');
if ( $terms ) {
// loop through artists (could be multiple)
foreach ( $terms as $term ) {
$termid = \'artists_\' . ($term->term_id);
echo \'<p id="artist-bio">\';
echo $term->description;
echo \'</p>\';
}
}
这很好,但如果可能的话,我希望出现换行符。我试着用
Rich Text Tags 插件将描述meta\\u框变成了所见即所得TinyMCE文本编辑器,但我无法获得提供的代码来打印任何内容。这是我尝试的代码:
if(isset($wp_taxonomies)) {
// This is getting the friendly version of a taxonomy
// - not the hyphenated get_yoast_term_title()
$term = get_term_by( \'slug\', get_query_var( \'term\' ), get_query_var( \'artists\' ) );
if($term) {
echo \'<h2 class="pagetitle">\'.$term->name.\'</h2>\';
}
// If you have a taxonomy description, let\'er rip!
if(function_exists(\'get_yoast_term_description\') && get_yoast_term_description()) {
echo wptexturize(get_yoast_term_description());
}
}