WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Translation with Evolution (from Elegantthemes) (3 posts)

  1. InvinciP
    Member
    Posted 2 years ago #

    I'm using Polylang with Evolution themes (http://www.elegantthemes.com/gallery/evolution/). The plugin is very good indeed, really easy to use. Though I still have to ask for support about its front page. Evolution has two string which user can define in its panel: the big quote text and the description text under 'Recent Work'. The theme stores these string in wordpress option table and displays it like this: `echo get_option('evolution_homework_desc');

    I managed to translate this by using pll_register_string() on the file home.php but it didn't work:
    $homework_desc = get_option('evolution_homework_desc');
    pll_register_string('homework_desc', $homework_desc);
    echo pll__($homework_desc);

    Just don't know why it doesn't work. :sighed:

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 2 years ago #

    The 'pll_register_string' function must be called on the admin side, so may have its place in functions.php, whereas the pll__ function must be called when you need it. I have to be clearer in the documentation.

    in functions.php (or any other file called on admin side):

    $homework_desc = get_option('evolution_homework_desc');
    pll_register_string('homework_desc', $homework_desc);

    in your template file:

    $homework_desc = get_option('evolution_homework_desc');
    echo pll__($homework_desc);

    Hope it helps!

  3. InvinciP
    Member
    Posted 2 years ago #

    Thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags