Sacconi69

function breadcrumb_sac

Apr 23rd, 2024
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. //nuovo breadcrumbs prova
  2.  
  3. add_filter('bcn_breadcrumb_title', 'breadcrumb_sac', 20, 3 );
  4.  
  5. function breadcrumb_sac ( $title, $types, $item_id ) {
  6.  
  7. $lang = substr( get_locale(), 0, 2 );
  8.  
  9. if ('it' != $lang ) {
  10.  
  11. if ( ! empty($title_lang ) )
  12. $title_lang = get_term_meta($item_id , "title_archive_$lang", true );
  13.  
  14. //nuovo blocco
  15. if ( in_array('post', $types ) || in_array('home', $types )) {
  16. $title_lang = get_term_meta($item_id , "title_archive_$lang", true );
  17. }
  18. if ( in_array('taxonomy', $types )) {
  19. $title_lang = get_term_meta($item_id , "title_archive_$lang", true );
  20. }
  21. if ( ! empty($title_lang )) return $title_lang;
  22.  
  23. //fine nuovo blocco
  24.  
  25.  
  26. }
  27.  
  28. return $title;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment