Support » Plugin: Yoast SEO » Breadcrumbs function exists even if toggled off

  • Hi yoast,

    i think i found a issue with this function. It worked nicely before but it does not now anymore due to code changes in your plugin.

    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>
    

    still exists even if i turn off the breadcrumbs in your setting causing my own theme breadcrumbs to fail.

    pls can you load the function only when the option is activated like you did before in previous versions.

    Thanks

    https://wordpress.org/plugins/wordpress-seo/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Code should be now

    <?php if ( function_exists('yoast_breadcrumb') ) {
          $yoast_links_options = get_option( 'wpseo_internallinks' );
          $yoast_bc_enabled=$yoast_links_options['breadcrumbs-enable'];
          if ($yoast_bc_enabled) {
                   yoast_breadcrumb('<p id="breadcrumbs">','</p>');
          } else {
             //your own breadcrumbscode;
          }
    } ?>
    

    Best regards

    I think the problem is caused by this ability which has been added to your plugin.

    function wpseo_shortcode_yoast_breadcrumb() {
    	return yoast_breadcrumb( '', '', false );
    }
    add_shortcode( 'wpseo_breadcrumb', 'wpseo_shortcode_yoast_breadcrumb' );
    

    Please look here for more information on this: https://github.com/Yoast/wordpress-seo/issues/795.

    Hi

    Thanks for the feedback i wonder why i need the extra info though as you can see from above code we have a similar solution. I prefer the function check exists and then the option check method and not run the breadcrumbs call and check if the return is empty.

    This way i can avoid the array check and calling a option that might (even if the plugin is turned off) or not might exists if the plugin is or not is running anymore.

    Thanks anyway i will post on github next time.

    Glad you found a solution which suits you.

    Please be aware GitHub is only for bug report NOT for support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Breadcrumbs function exists even if toggled off’ is closed to new replies.