Title: Synchronize Theme options with String Translation
Last modified: August 31, 2016

---

# Synchronize Theme options with String Translation

 *  Resolved [dados](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/)
 * Hi,
 * I have a issues to Synchronize Theme options field with String Translation. I
   use wpml-config.xml and field in Theme options
 * In Theme option I have field
    `<input type="text" value="Call to action Title"
   id="theme_cta_title" name="theme_cta_title">`
 * My config file look like this:
 *     ```
       <wpml-config>
           <admin-texts>
               <key name="theme_cta_title" />
           </admin-texts>
       </wpml-config>
       ```
   
 * and in page.php I have this ( I think this is correct? )
 *     ```
       <?php
       $theme_cta_title = get_option('theme_cta_title');
       pll_e($theme_cta_title);
       ?>
       ```
   
 * And now, I open my Theme options page, write new string “Test Title” and its 
   show up in String Translation, but problem is when I change it on “String Translation”
   tab page [http://prntscr.com/9s2dql](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”
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960823)
 * 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](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960898)
 * 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](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960907)
 * found in database this.. maybe can help [http://prntscr.com/9sb1q9](http://prntscr.com/9sb1q9)
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960925)
 * You can [unserialize](http://www.unserialize.com/s/) the option_value of the `
   theme_mods_ahmz` to see if it’s the right option.
 *  Thread Starter [dados](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960950)
 * 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
               )
   
       )
       ```
   
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960951)
 * It seems that it’s not the right option. Which theme do you use? Is it freely
   available?
 *  Thread Starter [dados](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960952)
 * Its custom code theme 🙁 … Is it possible that I do not have <key name=”my_theme_options”
   > .. or how I can add it
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960956)
 * 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](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960977)
 * this is I get [http://prntscr.com/9sjiri](http://prntscr.com/9sjiri) and when
   I open to edit [http://prntscr.com/9sjiwz](http://prntscr.com/9sjiwz)
 *  Thread Starter [dados](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960978)
 * just to explain I change this $shortname = “theme”; to $shortname = “swt”; so
   now instead theme_cta_title I have swt_cta_title
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960979)
 * 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](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](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960984)
 * okay.. here it is..
 * I wrote “Title test” in theme option [http://prntscr.com/9skgve](http://prntscr.com/9skgve)
   and then its show up here [http://prntscr.com/9skh7y](http://prntscr.com/9skh7y)..
   but when I change it [http://prntscr.com/9skhkk](http://prntscr.com/9skhkk) Theme
   options string not updated [http://prntscr.com/9skhsa](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..
 *  Plugin Support [Chrystl](https://wordpress.org/support/users/chrystl/)
 * (@chrystl)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960985)
 * > 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](https://wordpress.org/support/users/dados/)
 * (@dados)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960986)
 * 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](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

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Synchronize Theme options with String Translation’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

## Tags

 * [string translation](https://wordpress.org/support/topic-tag/string-translation/)

 * 14 replies
 * 2 participants
 * Last reply from: [dados](https://wordpress.org/support/users/dados/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/synchronize-theme-options-with-string-translation/#post-6960986)
 * Status: resolved