Widget content and css
-
Hello!
I’m migrating to this plugin, but it seems that it does not support widget content translation? What about css content?
Like:
font-family: "[:en]font1[:ja]font2[:]"; font-size: [:en]19px[:ja]12px[:];Thank you!
-
Hi @iara-chan
Widget content is translating.All content is translating, not partial.
If You added in text widget this:
font-family: "[:en]font1[:ja]font2[:]"; font-size: [:en]19px[:ja]12px[:];It not be translated.
You need add translation for each language
for
en:font-family: "font1"; font-size: 19px;for
ja:font-family: "font2"; font-size: 12px;Hello!
I guess I did not explain it well. What I wanted was to add two fonts to the same class in style.css of my child theme to be used for each language.
I found a solution that worked, I’ll add it here for anyone who needs it.
Must be added in theme.php’s theme or child theme.Thank you very much for the support and for creating this plugin! We would be lost without this tool! 😀
function change_font_by_language() { if(strpos($_SERVER['REQUEST_URI'], 'jp') !== false){ $style = '<style> .my_custom_class { font-family: "myjapanesefont" !important; font-size: 12px !important; } </style>'; echo $style; } elseif(strpos($_SERVER['REQUEST_URI'], 'en') !== false){ $style = '<style> .my_custom_class { font-family: "myenglishfont" !important; font-size: 19px !important; } </style>'; echo $style; } else{ $style = '<style> .my_custom_class { font-family: "myenglishfont" !important; font-size: 19px !important; } </style>'; echo $style; } } add_action( 'wp_head', 'change_font_by_language' );
The topic ‘Widget content and css’ is closed to new replies.