Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme
I've purchased the Yoast SEO Premium plugin earlier this year, but I wasn't able to figure out how to enable breadcrumbs until a few days ago. At first I thought I had to add blocks to every page and post, and I thought that would be incredibly tedious, until I found this article.
Since I was already using the Twentytwentyone theme, I decided to add the code to its header.php
file.
?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb( 'p id=breadcrumbs','/p' );
}
?
When I went to reload the site to see if the breadcrumbs showed up, I got a critical error, so I went into my log and saw this error.
[Sun Oct 03 02:32:59.026295 2021] [php7:error] [pid 8225] [client 172.68.133.221:44594] PHP Fatal error: Uncaught Error: Call to undefined function \xc2\xa0\xc2\xa0yoast_breadcrumb() in /var/www/html/sensation-experience.com/public_html/wp-content/themes/twentytwentyone/header.php:35\nStack trace:\n#0 /var/www/html/sensation-experience.com/public_html/wp-includes/template.php(770): require_once()\n#1 /var/www/html/sensation-experience.com/public_html/wp-includes/template.php(716): load_template('/var/www/html/s...', true, Array)\n#2 /var/www/html/sensation-experience.com/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)\n#3 /var/www/html/sensation-experience.com/public_html/wp-content/themes/twentytwentyone/page.php(12): get_header()\n#4 /var/www/html/sensation-experience.com/public_html/wp-includes/template-loader.php(106): include('/var/www/html/s...')\n#5 /var/www/html/sensation-experience.com/public_html/wp-blog-header.php(19): require_once('/var/www/html/s...')\n#6 /var/www/html/sensation-experience.com/public_html/index.php(17): require('/var/www/html/s...')\n#7 {main}\n thrown in /var/www/html/sensation-experience.com/public_html/wp-content/themes/twentytwentyone/header.php on line 35, referer: https://www.sensation-experience.com/
From what it looks like, there seems to be something going on between the Yoast plugin and the theme, but I'm not sure what it could be.
Topic plugin-wp-seo-yoast breadcrumb php seo themes Wordpress
Category Web