Fixes breadcrum issue on attachment pages.
This commit is contained in:
parent
ea6aa13f2f
commit
b89beae146
|
@ -104,10 +104,15 @@ function tainacan_interface_the_breadcrumb() {
|
||||||
}
|
}
|
||||||
} elseif ( is_attachment() ) {
|
} elseif ( is_attachment() ) {
|
||||||
$parent = get_post($post->post_parent);
|
$parent = get_post($post->post_parent);
|
||||||
$cat = get_the_category($parent->ID); $cat = $cat[0];
|
|
||||||
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
|
$cat = get_the_category($parent->ID);
|
||||||
echo '<a href="' . esc_url(get_permalink($parent)) . '">' . $parent->post_title . '</a>';
|
if ( !empty($cat) && is_array($cat) && count($cat) ) {
|
||||||
if ($showCurrent == 1) echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
|
$cat = $cat[0];
|
||||||
|
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
|
||||||
|
echo '<a href="' . esc_url(get_permalink($parent)) . '">' . $parent->post_title . '</a> ' . $delimiter;
|
||||||
|
}
|
||||||
|
if ($showCurrent == 1)
|
||||||
|
echo ' ' . $before . get_the_title() . $after;
|
||||||
|
|
||||||
} elseif ( is_page() && !$post->post_parent ) {
|
} elseif ( is_page() && !$post->post_parent ) {
|
||||||
if ($showCurrent == 1) echo $before . get_the_title() . $after;
|
if ($showCurrent == 1) echo $before . get_the_title() . $after;
|
||||||
|
|
Loading…
Reference in New Issue