Advertisement
arie_cristianD

delete_category_on_breadcrumb

Jul 5th, 2023
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. add_filter('jnews_native_breadcrumb_category', 'delete_category');
  2.  
  3. function delete_category($breadcrumb) {
  4.     $pattern = '/<span[^>]*>\s*<a[^>]*>Category<\/a>\s*<\/span>/i';
  5.     $breadcrumb = preg_replace($pattern, '', $breadcrumb);
  6.     $pattern = '/(<a[^>]*>Home<\/a>)\s*<\/span>\s*<i class="fa fa-angle-right">/';
  7.     $replacement = '${1}</span>';
  8.     $breadcrumb = preg_replace($pattern, $replacement, $breadcrumb);
  9.     return $breadcrumb ;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement