• Resolved alexjuz

    (@alexjuz)


    How correctly write the output in template for function get_extended() to translate INTROTEXT with WPGlobus?

               <?php 
               $post = get_post($id); 
               $content = get_extended($post->post_content);
               echo apply_filters('the_content', $content['main']);
               ?>
    

    This code is not translating page introtext with WPGlobus… All other translations work well.

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

    (@alexgff)

    If you are using this piece of code in theme’s template file
    then you don’t need to use ‘apply_filters’.
    get_post() returns text in current language.
    Don’t forget to use tag “<!–more–>” in post content
    for correct work of get_extended() function

    Thread Starter alexjuz

    (@alexjuz)

    Thanks for reply, this updated code

    
               <?php 
               $post = get_post($id); 
               $content = get_extended($post->post_content);
               echo $content['main'];
               ?>
    

    does not add translation, and he begins to add {:en} at the beginning of introtext in all languages :((

    Plugin Contributor Alex Gor

    (@alexgff)

    Try this

    
    <?php 
      $post = get_post($id); 
      $post->post_content = WPGlobus_Core::text_filter($post->post_content, WPGlobus::Config()->language);
      $content = get_extended($post->post_content);
      echo $content['main'];
     ?>
    
    Thread Starter alexjuz

    (@alexjuz)

    Thank You, everything OK, now translating works!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘untranslatable function get_extended()’ is closed to new replies.