Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1287526
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 3 years ago.
Improve this questionI'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/public_html/wp-content/themes/twentytwentyone/header.php:35\nStack trace:\n#0 /var/www/html/sensation-experience/public_html/wp-includes/template.php(770): require_once()\n#1 /var/www/html/sensation-experience/public_html/wp-includes/template.php(716): load_template('/var/www/html/s...', true, Array)\n#2 /var/www/html/sensation-experience/public_html/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)\n#3 /var/www/html/sensation-experience/public_html/wp-content/themes/twentytwentyone/page.php(12): get_header()\n#4 /var/www/html/sensation-experience/public_html/wp-includes/template-loader.php(106): include('/var/www/html/s...')\n#5 /var/www/html/sensation-experience/public_html/wp-blog-header.php(19): require_once('/var/www/html/s...')\n#6 /var/www/html/sensation-experience/public_html/index.php(17): require('/var/www/html/s...')\n#7 {main}\n thrown in /var/www/html/sensation-experience/public_html/wp-content/themes/twentytwentyone/header.php on line 35, referer: /
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.
本文标签: phpGetting error when trying to implement sitewide breadcrumbs in Twentytwentyone Theme
版权声明:本文标题:php - Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741289369a2370457.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论