[Resolved] Breadcrumb

  • Author
    Posts
  • #11508

    LCH
    Participant

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

    #11518

    Andrew Misplon
    Keymaster

    Hi LCH

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

    #11519

    LCH
    Participant
    This reply has been marked as private.
    #11520

    Andrew Misplon
    Keymaster

    Thanks for the link. Which plugin are you using for the breadcrumbs?

    Breadcrumb NavXT has the options you’re looking for: https://wordpress.org/plugins/breadcrumb-navxt/.

    #11521

    LCH
    Participant

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

    #11522

    Andrew Misplon
    Keymaster

    Iā€™m not sure if Yoast has the same granular settings but you can check them out.

    Implement Yoast SEO breadcrumbs

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

    #11523

    LCH
    Participant

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

    #11524

    LCH
    Participant

    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.

    #11533

    Andrew Misplon
    Keymaster

    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' );
    #11535

    LCH
    Participant

    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.

    #11536

    Andrew Misplon
    Keymaster

    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.

    #11538

    LCH
    Participant

    It works perfectly now, thank you very much.

    #11539

    Andrew Misplon
    Keymaster

    Awesome šŸ™‚ Glad to hear that helped.

    All the best.

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.

Scroll to top