• Resolved lukaszadms

    (@lukaszadms)


    Hey Guys,

    so my problem is, I use the underscores theme which is basically the same as you would create a theme by yourself.

    I create a new page with wordpress and then I select the template for this page. This means every page obtain its content from a template.

    With the WPLanguage plugin however, I can not use these kind of templates for different languages. Do you think, there is a way to solve this?

    Appreciate any help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Alex Gor

    (@alexgff)

    you can use code as example to include language’s specific file in your template

    
    if ( class_exists( 'WPGlobus' ) ) {
      $file_default = 'page-language-'.WPGlobus::Config()->default_language.'.php';
      foreach ( WPGlobus::Config()->enabled_languages as $lang ) {
        $file = 'page-language-'.$lang.'.php';
        if ( file_exists($file) ) {
          require_once($file);
        } else {
          require_once($file_default);
        }
      }
    }
    
    • This reply was modified 7 years, 4 months ago by Alex Gor.
    Thread Starter lukaszadms

    (@lukaszadms)

    thanks for the answer, should I just paste it in the php file?

    Thread Starter lukaszadms

    (@lukaszadms)

    I mean functions.php sorry

    Plugin Contributor Alex Gor

    (@alexgff)

    1.you can use this code just as example
    2.you can copy/paste this code adding file “page-language-{{default_language}}.php” in your theme

    Plugin Contributor Alex Gor

    (@alexgff)

    > I mean functions.php sorry
    are you seriously?

    Earlier you wrote
    > then I select the template for this page.
    Did you forget ?

    Thread Starter lukaszadms

    (@lukaszadms)

    I copied the wrong filename, sry. Thanks for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using Templates instead of the WP Editor to insert Text, how to use wpglobus?’ is closed to new replies.