Advertisement
Guest User

Fixing WPML duplicate taxonomies

a guest
Mar 18th, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2. echo str_replace( ' @' . ICL_LANGUAGE_CODE, '', get_queried_object()->name ) /* questo perché WPML aggiunge un suffisso se le tassonomie hanno lo stesso nome tra una lingua e l'altra */
  3. ?>
  4.  
  5. <?php
  6. /*
  7.  * WPML aggiunge un suffisso al nome della tassonomia se esiste già un'altra tassonomia con lo stesso NOME,
  8.  * questo filtro elimina nel front-end il prefisso
  9.  *
  10.  * IMPORTANTE: Il nuovo titolo deve essere definito prima che ne venga fatto il return
  11.  */
  12. add_filter('wp_title', 'wp_title_custom', 10, 1);
  13. function wp_title_custom($title) {
  14.  
  15.     $newTitle = str_replace(' @' . ICL_LANGUAGE_CODE, '', $title);
  16.  
  17.     return $newTitle;
  18.  
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement