This code has to be put in the template (child theme if u want), where you want it to appear. Most probably in the header section or all files (page, archive..)
No need to put it in the function file.
Thanks for answering. My blog is http://www.anacastrolopez.es. Right now I put bread crumbs with a particular topic, I copied the code breadcrumbs SEO by Yoast plugin in the header.php but I have no place in that topic, could you tell me which is customizr file in which I have to do the modification? thank you
Sorry but @groupewibi is offering poor advice above. You most definitely should not hack core files in Czr, but use a Child Theme and add hooks to the functions.php.
Not tried this before, but try this:
add_action('wp_head','my_yoast_breadcrumb',1,20);
function my_yoast_breadcrumb() {
if (function_exists ('yoast_breadcrumb')) {
yoast_breadcrumb ('<p id = "breadcrumbs">', '</ p>');
}
}
Is it necessary to open this code with the <? php and closing it with?>? Thanks in advance
functions.php always starts with a <?php and does not need a ?>. So by the time you add a few functions, it should already be included.
In the context of articles I’ve seen adding it, they are suggesting modifying core files which is when they would be necessary.
I turned off the breadcrumbs of the subject and I have put the code that you have told me in the child theme function.php file
<? php
add_action (‘wp_head’, ‘my_yoast_breadcrumb’, 1.20);
my_yoast_breadcrumb function () {
if (function_exists (‘yoast_breadcrumb’)) {
yoast_breadcrumb (‘<p id = “breadcrumbs”>’, ‘</ p>’);
}
}
Now just wait for the moment do not appear to work, I’ll wait until tomorrow. Thanks for the help
<? php
add_action (‘wp_head’, ‘my_yoast_breadcrumb’, 1.20);
my_yoast_breadcrumb function () {
if (function_exists (‘yoast_breadcrumb’)) {
yoast_breadcrumb (‘<p id = “breadcrumbs”>’, ‘</ p>’);
}
}
Was that your typos, or is that what you have in the functions.php? It is not an exact copy of my code above.
sorry, was my mistake, this is exactly what the file copy of the subject child functions.ph
<?php
add_action(‘wp_head’,’my_yoast_breadcrumb’,1,20);
function my_yoast_breadcrumb() {
if (function_exists (‘yoast_breadcrumb’)) {
yoast_breadcrumb (‘<p id = “breadcrumbs”>’, ‘</ p>’);
}
}
Hello, does not the code that you have provided me, bread crumbs SEO by Yoast plugin not appear. My blog is http://www.anacastrolopez.es. Do you could have a look and give me another code to see if it works?
<?php
add_action(‘wp_head’,’my_yoast_breadcrumb’,1,20);
function my_yoast_breadcrumb() {
if (function_exists (‘yoast_breadcrumb’)) {
yoast_breadcrumb (‘<p id = “breadcrumbs”>’, ‘</ p>’);
}
}