
-
AuthorPosts
-
October 11, 2019 at 2:29 pm #1147135
Hi!
We use Enfold V4.6.3.1 as a child theme at a testsite at a subdomain to circumvent the need to repeat changes to the breadcrumbs trail to get rid of the “You are here:”-prefix in future releases of Enfold.
So I downloaded the class-breadcrumbs.php file from the actual parent theme folder, made the changes replacing the string ‘You are here:’ with ‘ ‘ in line 26:
echo '<p class="breadcrumb"><span class="breadcrumb_info">'.__(' ','avia_framework').'</span> <a href="'.get_bloginfo('url').'">';
and in line 186:
before' => '<span class="breadcrumb-title">' . __( ' ', 'avia_framework' ) . '</span>'
I then uploaded the new file to my Enfold-child folder with the same name and corresponding dir path (“/wp-content/themes/enfold-child/framework/php”) to the parent theme folder to override the parent theme behaviour.
I then changed the functions.php-file of the child theme to add this filter as advised in an older forum post I found at kriesi.at:
<?php /* * Add your own functions here. You can also copy some of the theme functions into this file. * WordPress will use those functions instead of the original functions then. */ /* XXXXXXXX change made according to: * https://kriesi.at/support/topic/replace-class-breadcrumbs-php-in-child-theme/ */ add_filter('avia_breadcrumbs_args', 'avia_change_bc_truncate', 50, 1); function avia_change_bc_truncate($args){ $args['truncate'] = 30; return $args; }
However, after uploading the class-breadcrumb.php file, clearing caches and reloading the site (Strg&F5) repeatedly in different browsers (Firefox, Chrome) the changes I made are not showing at all, the nasty “You are here”-prefix is still there.
I’ve seen in the forum, that other people have similar problems with the breadcrumbs-class, if this is the case, what’s the point in using a child theme ?
Kind regards,
Guuu-
This topic was modified 5 years, 7 months ago by
iuntergu.
October 16, 2019 at 9:06 am #1148341Hey Guuu,
In functions-enfold.php (line 502):
if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true));
try to replace it with:
if($breadcrumb) $additions .= avia_breadcrumbs(array('separator' => '/', 'richsnippet' => true, 'before' => '<span class="breadcrumb-title"></span>'));
Hope it helps.
Best regards,
NikkoOctober 16, 2019 at 12:42 pm #1148439Hey, Nikko!
It does (alas I don’t understand exactly why (by adding the title, which was there before in the generated html) ;)), when I change the functions-enfold.php in the folder of the parent theme. Thank you so far, Nikko!
Alas if I reupload the original functions-enfold.php (V4.6.3.1) to the parent and put the changed functions-enfold.php into the corresponding directory structure of the child theme (/wp-content/themes/enfold-child/) to circumvent the need to change it with every Enfold Update it does not … So I have two alternatives now to get rid of the nasty prefix (changing functions-enfold.php or class-breadcrumbs.php), but only for a parent theme, not for the child, which was the purpose of the whole exercise ?
Thx & best regards,
GuuuOctober 18, 2019 at 1:57 am #1149071Hi Guuu,
To replace it via the child theme, you’ll need to define function avia_title in the functions.php of your child theme.
Just copy the whole function, don’t include:if(!function_exists('avia_title')) {
then replace the breadcrumb part which I mentioned above.
Best regards,
NikkoOctober 18, 2019 at 3:18 pm #1149296Hey, Nikko!
Worked perfectIy, thank you so much!!!
I copied the changed avia_title-function from my modified functions-enfold.php to the functions.php of the child theme without the if-clause as advised, deleted the functions-enfold.php in the child dir entirely, checked if the files of the parent theme are free from any traces of my change attempts – cleared chache, reloaded the site and it worked like a charm, thanks!!
I even deleted the /framework/php/-directory with the altered breadcrumb-class-file for a clean-up of my enfold-child-folder, perfect!!!
You girlz & boyz at kriesi’s support rock!!!
You can close this thread!
Thx-a-lot, have a nice …,
Guuu.-
This reply was modified 5 years, 6 months ago by
iuntergu.
October 18, 2019 at 5:48 pm #1149362Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
This topic was modified 5 years, 7 months ago by
-
AuthorPosts
- The topic ‘Replacing class-breadcrumbs.php via child theme to get rid of "You..here"-prefix’ is closed to new replies.