Tagged: breadcrumb
-
AuthorPosts
-
August 16, 2018 at 4:56 pm #998000
Dear Enfold,
Could you please remove the category from the ‘breadcrumbs’? Is it doable with CSS?
screenshot: https://imgur.com/a/vx7Ulj2Feel free to instantly fix this using the personal informatin below.
Please not that the website currently is very slow.
Thanks in advance ;).
Kind regardsAugust 17, 2018 at 9:19 am #998343Hey jeroenvandessel,
I added following code to the functions.php to solve the issue:
add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 ); function avia_breadcrumbs_trail_mod( $trail, $args ) { foreach ($trail as $key => $value) { if(strpos($value, '/category/vacatures/') !== false) { unset($trail[$key]); } } return $trail; }
The code removes the category link from the breadcrumb.
Best regards,
DudeAugust 17, 2018 at 9:32 am #998347Dear Dude,
Looks great! Thanks!
Does the change stay if I update Enfold in the future?Kind regards,
August 17, 2018 at 1:35 pm #998432Hi,
No, because you’re not using a child theme. If you want an update-safe solution you could create a custom plugin with my code.
1) Delete the code I added to the functions.php file
2) Create a text file and paste this code into it:<?php /* Plugin Name: Enfold Custom Code Description: Contains Enfold Custom Code Version: 1.0 Author: InoPlugs Plugin URI: https://inoplugs.com Author URI: https://inoplugs.com */ /** * Breadcrumb Fix * * @return array */ add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 ); function avia_breadcrumbs_trail_mod( $trail, $args ) { foreach ($trail as $key => $value) { if(strpos($value, '/category/vacatures/') !== false) { unset($trail[$key]); } } return $trail; }
3) Save the text file with a php extension – i.e. call it “enfold_plugin.php” (without the quotes).
4) Go to Plugins > Add New and upload the file. Then activate it like a standard wordpress plugin.Best regards,
Dude -
AuthorPosts
- You must be logged in to reply to this topic.