边走边学。。。
我已经构建了这个功能,但我需要它作为一个短代码。我该怎么做?
$args = array( \'taxonomy\' => \'product_cat\' );
$terms = get_terms(\'product_cat\', $args);
$count = count($terms); $i=0;
if ($count > 0) {
$cape_list = \'<p class="my_term-archive">\';
foreach ($terms as $term) {
$i++;
$term_list .= \'<a href="/term-base/\' . $term->slug . \'" title="\' . sprintf(__(\'View all post filed under %s\', \'my_localization_domain\'), $term->name) . \'">\' . $term->name . \'</a>\';
if ($count != $i) $term_list .= \' · \'; else $term_list .= \'</p>\';
}
echo $term_list;
}