Custom name in breadcrumbs first element

January 2013 WordPress Theme
GK User
Thu Oct 17, 2013 12:59 pm
Hi,

It must be very easy to do but I can't find the way.....As you can see here http://wp.xeraco.es/urbanisme/ the first element is "Ajuntament de Xeraco" which is the name of the site, but I want to change it for "Inici" (home translated to catalan).
User avatar
Senior Boarder

GK User
Thu Oct 17, 2013 2:16 pm
You can do it by editing template core file:
wp-content/themes/News/gavern/helpers/helpers.layout.php
(or better use child theme to override this file)
and change this line:
Code: Select all
echo '<a href="' . home_url() . '" class="gk-home">' . get_bloginfo('name') . "</a>";

to:
Code: Select all
echo '<a href="' . home_url() . '" class="gk-home">' . 'Your Custom Text' . "</a>";
User avatar
Moderator

GK User
Thu Oct 17, 2013 4:06 pm
Yes, I use a child-theme....it worked. :P But the code in helpers.layout.php is slightly different from what you said. So I changed the two instances of "get_bloginfo('name')" that I found in that file:

line 368
Code: Select all
// return the Home link
      $output .= '<a href="' . home_url() . '" class="gk-home">' . apply_filters('gavern_breadcrumb_home', get_bloginfo('name')) . "</a>";

In this case I changed the whole pattern "apply_filters('gavern_breadcrumb_home', get_bloginfo('name'))"

line 406
Code: Select all
// output the home link only
      $output .= '<a href="' . home_url() . '" class="gk-home">' . get_bloginfo('name') . "</a>";


Not sure if this is completely right but it worked. :roll:
User avatar
Senior Boarder

GK User
Thu Oct 17, 2013 4:07 pm
Sorry, I had older file - the Way You did it was 100% correct.
User avatar
Moderator

GK User
Thu Oct 17, 2013 6:56 pm
Fine. Thanks!
User avatar
Senior Boarder


cron