• Resolved natalarionova

    (@natalarionova)


    Hi @valexar!

    I am trying to create right ‘wpm-config.json’, but I didn’t find examples for my case. Could you help me with advise, please?

    I use WP ‘Add_setting_field’ function, so I have some new options. All of these options are text-inputs.

    When I edit the values on these pages:
    /wp-admin/options-general.php?edit_lang=ru
    /wp-admin/options-general.php?edit_lang=de
    /wp-admin/options-general.php?edit_lang=en
    the values are the same for different languages.

    I use WP theme – twentyseventeen.
    So I put ‘wpm-config.json’ to the root of my theme with text:

    {
    "options": {
    "theme_mods_twentyseeventeen":{
    "questions": {}
    }
    }
    }

    But it doesn’t work, I can’t understand what’s wrong.

    @valexar, I hope you can help me. Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Right name is ‘theme_mods_twentyseventeen’.

    Thread Starter natalarionova

    (@natalarionova)

    I’m sorry, it was mistake.

    I have this code:

    {
    "options": {
    "theme_mods_twentyseventeen":{
    "questions": {}
    }
    }
    }

    “questions” – name of my text-input

    Option ‘theme_mods_themename’ using for adding theme fields in customizer. And then get it on ‘get_theme_mod()’ function. Maybe You doing something wrong?
    Pege options-general has nothing to do with it.

    Thread Starter natalarionova

    (@natalarionova)

    I didn’t know about differences between ‘register_setting()’ and ‘set_theme_mod()’ (sorry, I’m new at WordPress)

    So, I’ve changed config:

    {
    "options": {
    "questions": {}
    }
    }

    and everything became OK. Thanks @valexar for the clue

    Ok. I will mark it question as solved.

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

The topic ‘Multilang for ‘Add_setting_field’ function’ is closed to new replies.