我有各种自定义分类,
有时,我会在后端选择多个选项(cf屏幕截图)
然而,在前端,我只有一个得到显示,我想他们都被显示在前端。。
这是我调用它们在前端显示的方式:
<?php
$taxonomy = wp_get_post_terms( $post->ID, \'category_job\');
$locations = wp_get_post_terms( $post->ID, \'locations\', array("fields" => "all"));
$types = wp_get_post_terms( $post->ID, \'types\');
$sectors = wp_get_post_terms( $post->ID, \'sectors\');
$salaries = wp_get_post_terms( $post->ID, \'salaries\');
$price = wp_get_post_terms( $post->ID, \'price-range\');
echo \'<strong>Category:</strong> \'.$taxonomy[0]->name.\'<br>\';
echo \'<strong>Location:</strong> \'.$locations[0]->name.\'<br>\';
echo \'<strong>Sector:</strong> \'.$sectors[0]->name.\'<br>\';
echo \'<strong>Salary:</strong> \'.$price[0]->name.\'£\'.\'<br>\';
echo \'<strong>Type:</strong> \'.$types[0]->name.\'<br>\';
?>
任何帮助都将是惊人的:)
谢谢你们的时间伙计们!