lighter77
lighter77

Reputation: 21

How can I change only the "home" text in breadcrumb?

I am trying to change the "home" text in breadcrumb in wordpress.

I saw a great fix here with some css code which was this:

.breadcrumb a:first-child:after {
   content: "Something Else";
   font-size: 14px;
}

This worked great but it is also changed the second text (the category text).

How can I change only the first line (the "home" text)?

Many thanks for anyone who can help...

Upvotes: 1

Views: 3898

Answers (1)

Alireza Sabahi
Alireza Sabahi

Reputation: 675

try using this code if you are using woocommerce:

add_filter( 'woocommerce_breadcrumb_defaults', 'wcc_change_breadcrumb_home_text' );
function wcc_change_breadcrumb_home_text( $defaults ) {
// Change the breadcrumb home text from 'Home' to everything
$defaults['home'] = 'Your Desired Name';
return $defaults;
}

add this code at the end of your theme function.php

Upvotes: 2

Related Questions