【发布时间】:2011-04-27 17:03:45
【问题描述】:
我正在寻找一种方法来从我的面包屑主题的 get_category_parents 中排除 ID 为 3 和 4 的类别。这是代码,有问题的行是11:
function the_breadcrumb() {
global $post;
if (!is_home()) {
echo '<a href="'.get_option('home').'">'.home.'</a>';
if (is_category()) {
echo " / ";
echo single_cat_title();
} elseif(is_single() && !is_attachment()) {
$cat = get_the_category(); $cat = $cat[0];
echo " / ";
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo " / ";
echo thman_get_limited_string($post->post_title,30);
}
elseif (is_search()) {
echo " / " . cerca;
}
elseif (is_page() && $post->post_parent) {
echo ' / <a href="'.get_permalink($post->post_parent).'">';
echo get_the_title($post->post_parent);
echo "</a> / ";
echo thman_get_limited_string($post->post_title,30);
}
elseif (is_page() OR is_attachment()) {
echo " / ";
echo thman_get_limited_string($post->post_title,30);
}
elseif (is_author()) {
echo wp_title(' / Profilo');
echo "";
}
elseif (is_404()) {
echo " / ";
echo errore_404;
}
elseif (is_archive()) {
echo wp_title(' / ');
}
}
}
【问题讨论】:
标签: wordpress categories