Implementing Yoast breadcrumbs

Hi,
I am trying to implement Yoast breadcrumbs.
I have put the following code into my child theme functions.php

if ( ! function_exists( ‘x_breadcrumbs’ ) ) :
function x_breadcrumbs() {

if ( x_get_option( ‘x_breadcrumb_display’, 1 ) && function_exists(‘yoast_breadcrumb’) ) {
echo “This is a test”;
} else {
echo ‘

Please install Yoast Breadcrumb plugin.

’;
}
}
endif;

Then I have enabled Yoast breadcrumbs on the site. It is still showing X breadcrumbs.
I have cleared my cache and that hasn’t worked. Please can you help me.
Thanks

Hello @sarahlouisewaterhouse,

Thanks for writing in!

1.) Make sure that your child theme’s functions.php file looks like this:

<?php

// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to X in this file.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Enqueue Parent Stylesheet
//   02. Additional Functions
// =============================================================================

// Enqueue Parent Stylesheet
// =============================================================================

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );



// Additional Functions
// =============================================================================
if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
         
if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
        wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'x-stack','x-cranium-migration' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );
if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {

    if ( x_get_option( 'x_breadcrumb_display', 1 ) && function_exists('yoast_breadcrumb') ) {
      yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } else {
      echo '<p>Please install Yoast Breadcrumb plugin.</p>';
    }

  }
endif;

2.) Make sure that the Child theme is activated.

Please check out this old thread instead:

Best Regards.

Thank you so much! :slight_smile:

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.