Results 1 to 10 of 10
  1. #1
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,191
    Thanks
    801
    Thanked 581 Times in 428 Posts

    Default Changing Breadcrumbs

    I am trying to change breadcrumbs, I found the breadcrumb file in the wordpress theme. This is the first part of the old code

    <?php

    if (!function_exists('show_breadcrumbs')) {

    function show_breadcrumbs() {

    $delimiter = '&raquo;';
    $name = 'Home'; //text for the 'Home' link
    $currentBefore = '<span class="current_crumb">';
    $currentAfter = '</span>';

    New Code

    <?php

    if (!function_exists('show_breadcrumbs')) {

    function show_breadcrumbs() {

    $delimiter = '&raquo;';
    $name = 'MY Own Breadcrumb'; //text for the 'MY Own Breadcrumb' link
    $currentBefore = '<span class="current_crumb">';
    $currentAfter = '</span>';

    ____________


    In yoast it gives you an option to change the name of the breadcrumb but it says to install this code

    <?php if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    } ?>


    but I have not idea where to insert this code. It says "In the theme" Anyone know where I put this?

  2. #2
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,045
    Thanks
    3,710
    Thanked 8,720 Times in 5,561 Posts

    Default

    You might want to read up on this, but maybe it needs to go in the functions file.

    The if statement references whether the function exists so only a quick guess.

    Obviously if you want to try this, back up the file first.
    I also suggest making the change in ftp, NOT in the wordpress back end, if it would crash the site you could remove it more quickly.

    The functions file should exist in wp-content/themes/functions .php

    Rick
    Universal4

  3. The Following User Says Thank You to universal4 For This Useful Post:

    edgarf76 (26 September 2014)

  4. #3
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,191
    Thanks
    801
    Thanked 581 Times in 428 Posts

    Default

    Quote Originally Posted by universal4 View Post
    You might want to read up on this, but maybe it needs to go in the functions file.

    The if statement references whether the function exists so only a quick guess.

    Obviously if you want to try this, back up the file first.
    I also suggest making the change in ftp, NOT in the wordpress back end, if it would crash the site you could remove it more quickly.

    The functions file should exist in wp-content/themes/functions .php

    Rick
    Universal4
    Does anyone know if I just paste the code in there? I tried doing it in the breadcrumb file but it didn't work. Do I need to wrap it in html tags?

  5. #4
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,045
    Thanks
    3,710
    Thanked 8,720 Times in 5,561 Posts

    Default

    If I understand what you are asking, you would place the code (the second part you listed in the first post) inside of the functions file.

    DO NOT use the open or close php portion ( <?php or ?> )

    After the function exists, it may be that yoast adds a section where you can change this easily, although I am not sure as I have never used the plugin or that function.

    Any time I edit php code directly, I usually try to use an editor like edit plus (since it automatically creates a .bak of the fil when you save it) and it preserves line numbers. I will often also keep notes on the line numbers I added, and if something goes wrong you can easily get the file back to where it was.

    This also helps you for future functions editing etc, since you will have notes ion what worked on previous sites.

    Rick
    Universal4

    To clarify,
    you would start with
    if and end with
    }

    Code:
    if ( function_exists('yoast_breadcrumb') ) {
    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
    }

  6. The Following User Says Thank You to universal4 For This Useful Post:

    edgarf76 (26 September 2014)

  7. #5
    Christiaan's Avatar
    Christiaan is offline Private Member
    Join Date
    February 2013
    Location
    Barcelona
    Posts
    1,279
    Thanks
    182
    Thanked 486 Times in 336 Posts

    Default

    I never used this before but how I understand it, you should put this code where you want the breadcrumb to be visible. For example in themefolder/single.php if you want the breadcrumb to show up on every single post.

  8. The Following User Says Thank You to Christiaan For This Useful Post:

    edgarf76 (26 September 2014)

  9. #6
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,045
    Thanks
    3,710
    Thanked 8,720 Times in 5,561 Posts

    Default

    Yea, reading this
    https://managewp.com/breadcrumbs-wordpress-seo-by-yoast

    It appears you may not have to edit the functions file at all....

    Rick
    Universal4

  10. The Following User Says Thank You to universal4 For This Useful Post:

    edgarf76 (26 September 2014)

  11. #7
    Bikram is offline Banned
    Join Date
    September 2014
    Location
    US
    Posts
    83
    Thanks
    2
    Thanked 5 Times in 4 Posts

    Default

    why you dont Try Yoast seo plugin there is responsive way of breadcrumbs just click Best easier way

  12. #8
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,045
    Thanks
    3,710
    Thanked 8,720 Times in 5,561 Posts

    Default

    He is using Yoast.

    Rick
    Universal4

  13. #9
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,191
    Thanks
    801
    Thanked 581 Times in 428 Posts

    Default

    Quote Originally Posted by christinaborsk View Post
    why you dont Try Yoast seo plugin there is responsive way of breadcrumbs just click Best easier way
    lI am using Yoast, and have a responsive HTML5 theme. I am not a coder, especially PHP. Yoast requires the webmaster to insert a piece of code in a file or from the artice @universal provded, there may be another plugin. I am going to experiment throughout the week with a website that does not get much traffic. After that need to figure out how to do this with sites not using yoast.

  14. #10
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,045
    Thanks
    3,710
    Thanked 8,720 Times in 5,561 Posts

    Default

    Keep us updated on this edgar, my guess is once you get it working it will probably not be complicated.

    Rick
    Universal4

  15. The Following User Says Thank You to universal4 For This Useful Post:

    edgarf76 (28 September 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •