• Thanks for the great theme.

    I’m creating a multilingual site using onepress with a child theme and the polylang plugin. I try to use the wpml-config.xlm file in order to translate the content of the front page section contents (features, services, etc).
    So in order to translate the titles of the features section the content of the wpml-config.xlm file should be:

    <wpml-config>
       <admin-texts>
          <key name='theme_mods_onepresschild'>
             <key name="onepress_features_boxes" >
                <key name="title" />
             </key>
          </key>
       </admin-texts>
    </wpml-config>

    Unfortunately this does not work. I examined the wp-options table of the database and I found that the section data are not saved as an array as they probably should be. Using the https://www.unserialize.com tool you can see that they are saved as a strings. I believe this to be the problem but I can not be 100% sure.

    Any ideas? Is there a way around this?

    Thanks in advance,

    Nick Pasadakis

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @nickpasadakis,

    Current our theme just available support for WPML plugin, we don’t check with Polylang plugin yet.

    Please try contact author’s plugin, might be they will let you know a good solution.

    Kind regards.

    Thread Starter nickpasadakis

    (@nickpasadakis)

    Hi @congthien

    Thanks for your reply.

    From my research I found out that polylang works with other themes that save the options as an array, which I believe is the “wordpress” way. For some reason onepress theme saves the options as a string. I doubt polylang’s authors will be able to help with that.

    Thank you again for your reply.

    Nick Pasadakis

    Hi,

    The OnePress theme using Customize API, and it save data as an array with option name : theme_mods_onepress . and with child theme, it should be : theme_mods_onepress-child . You can find it in your database.

    Kind regards.

    Thread Starter nickpasadakis

    (@nickpasadakis)

    Hi again @congthien,

    That bit works just fine. The problem is with fields of that array like onepress_features_boxes and onepress_counter_boxes which should also be arrays but are saved as strings that contain the information in an array form.
    For example, onepress_counter_boxes is saved like this:
    s:22:"onepress_counter_boxes";s:315:"[{"title":"Projects completed","number":"368","unit_before":"","unit_after":""},{"title":"Positive feedback","number":"99","unit_before":"","unit_after":"%"},{"title":"Pizzas ordered","number":"254","unit_before":"","unit_after":""},{"title":"Average cost per hour","number":"32","unit_before":"$","unit_after":""}]";

    This is not the same as the nav_menu_locations filed for example that is saved as an array:
    s:18:"nav_menu_locations";a:1:{s:7:"primary";i:16;}

    It is probably easier to paste the content of the theme_mods_onepress-child field in https://www.unserialize.com and check the results

    Hi @nickpasadakis,

    This is due to WordPress auto save like serialize array. We couldn’t change it ??

    Thread Starter nickpasadakis

    (@nickpasadakis)

    Thank you for your input @congthien. I’ll contact the polylang author and let you know what the verdict is!

    Thanks again,

    Nick Pasadakis

    Sure ??

    Have a nice day!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘multilingual site’ is closed to new replies.