';
echo '
';
echo '';
echo 'خانه';
echo '';
if ( is_category() ) {
$cat = get_queried_object();
if ( $cat->parent ) {
$parents = array();
$pid = $cat->parent;
while ( $pid ) {
$p = get_category( $pid );
$parents[] = $p;
$pid = $p->parent;
}
$parents = array_reverse( $parents );
foreach ( $parents as $p ) {
echo $sep;
echo '
' . esc_html( $p->name ) . '';
}
}
echo $sep;
echo '
' . esc_html( $cat->name ) . '';
} elseif ( is_single() ) {
$cats = get_the_category();
if ( $cats ) {
$cat = $cats[0];
$parents = array();
$pid = $cat->parent;
while ( $pid ) {
$p = get_category( $pid );
$parents[] = $p;
$pid = $p->parent;
}
$parents = array_reverse( $parents );
foreach ( $parents as $p ) {
echo $sep;
echo '
' . esc_html( $p->name ) . '';
}
echo $sep;
echo '
' . esc_html( $cat->name ) . '';
}
echo $sep;
echo '
' . esc_html( wp_trim_words( get_the_title(), 6, '…' ) ) . '';
} elseif ( is_page() ) {
global $post;
if ( $post->post_parent ) {
$ancestors = get_post_ancestors( $post->ID );
$ancestors = array_reverse( $ancestors );
foreach ( $ancestors as $anc_id ) {
$anc = get_post( $anc_id );
echo $sep;
echo '
' . esc_html( $anc->post_title ) . '';
}
}
echo $sep;
echo '
' . esc_html( get_the_title() ) . '';
} elseif ( is_tag() ) {
echo $sep;
echo '
برچسب: ' . esc_html( single_tag_title( '', false ) ) . '';
} elseif ( is_search() ) {
echo $sep;
echo '
جستجو: ' . esc_html( get_search_query() ) . '';
} elseif ( is_404() ) {
echo $sep;
echo '
صفحه پیدا نشد';
} elseif ( is_archive() ) {
echo $sep;
echo '
' . esc_html( get_the_archive_title() ) . '';
}
echo '
';
echo '