dgwatkins

show non-translated posts in default language

May 31st, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.37 KB | None | 0 0
  1. +    <?php
  2. +    global $sitepress;
  3. +    $sitepress->switch_lang($sitepress->get_default_language());
  4. +    query_posts();
  5. +    $sitepress->switch_lang(ICL_LANGUAGE_CODE);
  6. +    ?>
  7.    
  8.      <?php if (have_posts()) : ?>
  9.     <?php while (have_posts()) : the_post();
  10.  
  11. +         $post_id = icl_object_id(get_the_ID(), 'post', true);
  12. +         $post = get_post($post_id);
Advertisement
Add Comment
Please, Sign In to add comment