Advertisement
arie_cristianD

use different logo in multi language

Nov 13th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. add_filter( 'theme_mod_jnews_header_logo', 'change_logo_other_lang' );
  2. add_filter( 'theme_mod_jnews_header_logo_retina', 'change_retina_logo_other_lang' );
  3. add_filter( 'theme_mod_jnews_mobile_logo', 'change_mobile_logo_other_lang' );
  4. add_filter( 'theme_mod_jnews_mobile_logo_retina', 'change_mobile_retina_logo_other_lang' );
  5.  
  6.  
  7. /**
  8.  * Change desktop logo in other language
  9.  */
  10. function change_logo_other_lang( $value ) {
  11.     if ( function_exists( 'pll_get_term' ) ) {
  12.         if ( 'id' === pll_current_language() ) { /* change id with your language code */
  13.             $value = 'https://jnews.io/default/wp-content/uploads/sites/3/2017/01/logo1.png'; /* change the $value with your logo URL */
  14.         }
  15.     }
  16.     return $value;
  17. }
  18.  
  19.  
  20. /**
  21.  * Change desktop retina logo in other language
  22.  */
  23. function change_retina_logo_other_lang( $value ) {
  24.     if ( function_exists( 'pll_get_term' ) ) {
  25.         if ( 'id' === pll_current_language() ) { /* change id with your language code */
  26.             $value = 'https://jnews.io/default/wp-content/uploads/sites/3/2017/01/logo1@2x.png'; /* change the $value with your logo URL */
  27.         }
  28.     }
  29.     return $value;
  30. }
  31.  
  32.  
  33.  
  34. /**
  35.  * Change mobile logo in other language
  36.  */
  37. function change_mobile_logo_other_lang( $value ) {
  38.     if ( function_exists( 'pll_get_term' ) ) {
  39.         if ( 'id' === pll_current_language() ) { /* change id with your language code */
  40.             $value = 'https://jnews.io/default/wp-content/uploads/sites/3/2017/01/logo1.png'; /* change the $value with your logo URL */
  41.         }
  42.     }
  43.     return $value;
  44. }
  45.  
  46.  
  47.  
  48. /**
  49.  * Change mobile retina logo in other language
  50.  */
  51. function change_mobile_retina_logo_other_lang( $value ) {
  52.     if ( function_exists( 'pll_get_term' ) ) {
  53.         if ( 'id' === pll_current_language() ) { /* change id with your language code */
  54.             $value = 'https://jnews.io/default/wp-content/uploads/sites/3/2017/01/logo1@2x.png'; /* change the $value with your logo URL */
  55.         }
  56.     }
  57.     return $value;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement