Hi,
is it possible to avoid link tag in breadcrumb, if the page is private ? Indeed, it links to 404 page if you’re not connected, so just showing the page title in breadcrumb would be better.
Thanks,
Oli
Hi minestelecom!
Try following – open up wp-content\themes\enfold\framework\php\class-breadcrumb.php and replace
$parents[] = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . get_the_title( $post_id ) . '</a>';
with
if(get_post_status($post_id) == 'private'){
$parents[] = get_the_title( $post_id );
}else{
$parents[] = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . get_the_title( $post_id ) . '</a>';
}
Cheers!
Peter
Hi,
it doesn’t work, the breadcrumb displays in reverse…
But it’s ok, when replacing with :
if(get_post_status($post_id) == ‘private’)
$parents[] = ‘‘ . get_the_title( $post_id ) . ‘‘;
else
$parents[] = ‘‘ . get_the_title( $post_id ) . ‘‘;
Thanks for your help !