спасибо Шелли за ответ, но я не специалист по php, поэтому мой полный код должен выглядеть следующим образом?
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]->term_id;
// next will return an array of all category ancestors, with toplevel cat being [0]
$ancestors = array_reverse(get_ancestors($cat, 'category');
if($ancestors) {
// set up output
$output = '';
foreach($ancestor as $cat) {
// skips cats 3 and 4
if($cat == '3' || $cat == '4') continue;
$catlink = get_category_link($cat);
$catname = get_cat_name($cat);
$output .= '<a href="' . $catlink . '">' . $catname . '</a>' . "\n";
}
}
echo $output;
echo " / ";
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo " / ";
echo the_title_shorten(45,'...');
}
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 the_title_shorten(45,'...');
}
elseif (is_page() OR is_attachment()) {
echo " / ";
echo the_title_shorten(45,'...');
}
elseif (is_author()) {
echo wp_title(' / Profilo');
echo "";
}
elseif (is_404()) {
echo " / ";
echo errore_404;
}
elseif (is_archive()) {
echo wp_title(' / ');
}
}
}