Advertisement
arie_cristianD

delete_Tema_on_breadcrumb

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