• hello wanted to modify the breadcrumbs of the item breadcrumbs seo plugin by Yoast. The code for the breadcrumbs plugin by Yoast seo are
    <? php if (function_exists (‘yoast_breadcrumb’)) {
    yoast_breadcrumb (‘<p id = “breadcrumbs”>’, ‘</ p>’);
    }?>
    What I need to add code in the functions.php file of my child theme to make the modification?
    want bread crumbs SEO by Yoast plugin appear in the same place as the above topic title of each post and page. Thanks in advance

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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.

    Thread Starter rubiablanc

    (@rubiablanc)

    Thanks for answering. My blog is https://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>');
    	}
    }
    Thread Starter rubiablanc

    (@rubiablanc)

    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.

    Thread Starter rubiablanc

    (@rubiablanc)

    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.

    Thread Starter rubiablanc

    (@rubiablanc)

    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>’);
    }
    }

    Thread Starter rubiablanc

    (@rubiablanc)

    Thread Starter rubiablanc

    (@rubiablanc)

    Hello, does not the code that you have provided me, bread crumbs SEO by Yoast plugin not appear. My blog is https://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>’);
    }
    }

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘breadcrumbs’ is closed to new replies.