Resolved

Breadcrumb

Polestar Theme started by LCH Jan 13, 2019 12 replies
LCH Jan 13, 2019 · 11:06 am #11508

How can I remove breadcrumbs in specific landing pages for esthetic purpose?

Andrew Misplon Puro Jan 13, 2019 · 1:16 pm #11518

Hi LCH

Can you please, send a link to the page concerned so I can take a look.

LCH Jan 13, 2019 · 1:57 pm #11519

This reply has been marked as private.

LCH Jan 13, 2019 · 3:02 pm #11521

I’m using Yoast SEO. Is there any way to do that with Yoast?

LCH Jan 13, 2019 · 3:32 pm #11523

I still cannot hide breadcrumbs on pages even with breadcrumb navxt. Can you show me the way to do that?

LCH Jan 13, 2019 · 3:41 pm #11524

It seems that the theme polestar has already implemented the breadcrumb code for both Yoast and Breadcrumb Navxt. However, I cannot find the code in the theme files. If you can show me where it is, I might be able to choose where to show the breadcrumbs with a child theme.

Andrew Misplon Puro Jan 13, 2019 · 3:50 pm #11533

Hi, I just sent this link https://kb.yoast.com/kb/implement-wordpress-seo-breadcrumbs/ so you could see where the Yoast settings are to be found for breadcrumbs.

You can insert the following into your child theme functions.php file:

if ( ! function_exists( 'polestar_breadcrumbs' ) ) :
/**
 * Display Yoast SEO breadcrumbs or Breadcrumb NavXT below the header.
 */
function polestar_breadcrumbs() {
	if ( is_page() ) return;
	if ( function_exists( 'bcn_display' ) ) {
		?><div class="breadcrumbs bcn">
			<?php bcn_display(); ?>
		</div><?php
	} elseif ( function_exists( 'yoast_breadcrumb' ) ) {
		yoast_breadcrumb( '<div class="breadcrumbs">','</div>' );
	}
}
endif;
add_action( 'polestar_content_top', 'polestar_breadcrumbs' );
LCH Jan 13, 2019 · 4:03 pm #11535

I’m sorry but I lost you somewhere…
In the link you sent me, they said that the implementation code is often put in to single.php and/or page.php or header.php. But I can’t find any code like that in these files.

Andrew Misplon Puro Jan 13, 2019 · 4:08 pm #11536

The link I sent was only to show you where the Yoast SEO settings were.

“Looks like you can set the post types for display. Scroll down at the above link to see where the settings are.”

There is no need to insert code for Polestar, the integration code is already there.

Please, insert the function I provided above in your child theme functions.php file. I’ve included an early return in the function to exclude pages.

LCH Jan 13, 2019 · 4:13 pm #11538

It works perfectly now, thank you very much.

Andrew Misplon Puro Jan 13, 2019 · 4:15 pm #11539

Awesome 🙂 Glad to hear that helped.

All the best.

13 posts