Hi
If you use a wpml-config.xml you don’t need to use the Polylang function such as pll_e.
In your wpml-config.xml file you must have the name of the theme option:
<wpml-config>
<admin-texts>
<key name="my_theme_options">
<key name="option_name_1" />
</key>
</admin-texts>
</wpml-config>
Thread Starter
dados
(@dados)
1.) If you use a wpml-config.xml you don’t need to use the Polylang function such as pll_e.
– But how then I can echo string on page.php .. this CTA title need to be echo in H1 tag, from theme options, you mean to just echo like this
<?php
$theme_cta_title = get_option('theme_cta_title');
echo $theme_cta_title;
?>
2.) In your wpml-config.xml file you must have the name of the theme option:
– hmmm… I have this, can you please help me on xml file?
$themename = "My Theme";
$shortname = "theme";
$options = array (
array( "name" => $themename." Options",
"type" => "title"),
array("name" => "CTA TITLE",
"id" => $shortname."_cta_title",
"type" => "text",
"std" => 'Call to action Title'),
Thread Starter
dados
(@dados)
found in database this.. maybe can help http://prntscr.com/9sb1q9
You can unserialize the option_value of the theme_mods_ahmz to see if it’s the right option.
Thread Starter
dados
(@dados)
hmm when I paste option_value of the theme_mods_ahmz I get this , Is it possible that I do not have <key name=”my_theme_options”>
(
[0] =>
[nav_menu_locations] => Array
(
[primary-menu] => 9
[secondary-menu] => 10
)
)
It seems that it’s not the right option. Which theme do you use? Is it freely available?
Thread Starter
dados
(@dados)
Its custom code theme 🙁 … Is it possible that I do not have <key name=”my_theme_options”> .. or how I can add it
In your DB (PhpMyAdmin), go in wp_options, then in the search form. For the raw option_value you must select LIKE %..% (Operator column), and add Test Title (Value column).
Which result have you?
Thread Starter
dados
(@dados)
Thread Starter
dados
(@dados)
just to explain I change this $shortname = “theme”; to $shortname = “swt”; so now instead theme_cta_title I have swt_cta_title
I see you use only a simple option. Your wpml-config.xml is correct. Sorry I was a bit long to understand.
but problem is when I change it on “String Translation” tab page http://prntscr.com/9s2dql for example I write instead “Test Title” now is “Test Title String tab”, and text in filed on Theme Options page is not changed, is still “Test Title”
Could you provide some screenshots to illustrate that?
Thread Starter
dados
(@dados)
okay.. here it is..
I wrote “Title test” in theme option http://prntscr.com/9skgve and then its show up here http://prntscr.com/9skh7y .. but when I change it http://prntscr.com/9skhkk Theme options string not updated http://prntscr.com/9skhsa .. Instead “Title test sssss” I still have “Title test” .. on fronted its work okay, title is changed.
But I’m afraid when client want to change something in theme option, what will happen if click on save “Theme Option” because old string is remained..
Instead “Title test sssss” I still have “Title test” ..
It’s the normal behavior. The strings that you fill in the Strings translation table don’t override the Theme options. You have a change only on the front.
Thread Starter
dados
(@dados)
Ohh.. Okay.. Something I have now realized .. when I save theme options, on fronted its showing new string from translate field http://prntscr.com/9skhkk .. So its okay 🙂 .. this work.. ohhh how much posts and actually this works 🙁 I thought field in theme options also should be updated 🙁 .. sorry for all time you lost on me