-
AuthorPosts
-
January 5, 2015 at 4:45 am #374944
I’m looking to modify my breadcrumbs on woocommerce products a bit.
Here’s how they look: Home / Store / Books / War & Peace
Here’s what I want: Store > Books
So I need to:
1) Remove the Home link & trailing separator
2) Remove the Post title and preceding separator
3) Change the “/” separator to “>”This is the only place I’m using breadcrumbs so I have the freedom to change a lot of the code.
January 5, 2015 at 5:26 am #374951How do I start a thread?
Thanks,
January 5, 2015 at 6:36 pm #375231Hey!
Please go to Enfold/framework/php folder and open class-breadcrumb.php and find following line
$separator = '<span class="sep">' . $separator . '</span>';and change it to
$separator = '<span class="sep"> > </span>';and then add following code to Functions.php file in Appearance > Editor
add_filter('avia_breadcrumbs_args', 'avia_remove_home_breadcrumb', 10, 1); function avia_remove_home_breadcrumb($args){ $args['show_home'] = ""; return $args; }Best regards,
YigitJanuary 6, 2015 at 12:14 am #375411Thanks Yigit.
The separators still show as “/” after I edit the class-breadcrumb.php file.
The update to functions.php now shows a “Products” link in place of home. Products / Shop / Category / Product Name
January 6, 2015 at 6:29 am #375481I ended up using some css selectors I have not used before.
..breadcrumb span:last-of-type, .breadcrumb span:first-of-type, .breadcrumb-trail .sep {display: none;}So this hid the first and last parts of the trail along with the separators and left me with: Shop Books as the breadcrum trail which is close enough to what I want for now.
I think more flexibility or control of the titles of individual elements (posts, products, portfolios) is one area that could make the theme better.
-
AuthorPosts
- The topic ‘Breadcrumb Help’ is closed to new replies.
