yoast_breadcrumb

Template tag for breadcrumbs.

Description

(string) yoast_breadcrumb( (string) $before = '', (string) $after = '', (bool) $display = true ); 

Returns (string)

Parameters (3)

0. $before — Optional. (string) => ''
What to show before the breadcrumb.
1. $after — Optional. (string) => ''
What to show after the breadcrumb.
2. $display — Optional. (bool) => true
Whether to display the breadcrumb (true) or return it (false).

Usage

  1. if ( !function_exists( 'yoast_breadcrumb' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-functions.php'; 
  3.  
  4. // What to show before the breadcrumb. 
  5. $before = ''; 
  6.  
  7. // What to show after the breadcrumb. 
  8. $after = ''; 
  9.  
  10. // Whether to display the breadcrumb (true) or return it (false). 
  11. $display = true; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = yoast_breadcrumb($before, $after, $display); 
  15.  

Defined (1)

The function is defined in the following location(s).

/inc/wpseo-functions.php  
  1. function yoast_breadcrumb( $before = '', $after = '', $display = true ) { 
  2. $breadcrumbs_enabled = current_theme_supports( 'yoast-seo-breadcrumbs' ); 
  3. if ( ! $breadcrumbs_enabled ) { 
  4. $options = get_option( 'wpseo_internallinks' ); 
  5. $breadcrumbs_enabled = ( $options['breadcrumbs-enable'] === true ); 
  6.  
  7. if ( $breadcrumbs_enabled ) { 
  8. return WPSEO_Breadcrumbs::breadcrumb( $before, $after, $display );