Title: get_template_part issue
Last modified: August 22, 2016

---

# get_template_part issue

 *  [eavinu](https://wordpress.org/support/users/eavinu/)
 * (@eavinu)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_template_part-issue/)
 * Hello again Chouby,
 * I have this piece of code in a plugin and it always takes the default language
   which is Hebrew (the plugin is ultimate quick view).
    When browsing the English
   site and clicking the quick view link on an image of a product (woocommerce) 
   it renders the template part from the Hebrew which means all the alterations 
   in the template file which contains if $currentlang etc’ is being ignored and
   only the data from Hebrew is taken and the names of “price” and others are not
   showing in English… The piece of code in the plugin:
 *     ```
       <body <?php body_class(); ?>>
                   <?php
                   echo '<div class="single_woocommerce" style="padding:10px;">';
                   do_action('woocommerce_before_main_content');
                   while ( have_posts() ) : the_post();
       				$post->ID = get_the_ID();
       				wc_get_template_part( 'content', 'single-product' );
                   endwhile;
                   if (function_exists('add_masonry_layout')) add_masonry_layout();
                   do_action('woocommerce_before_main_after');
                   echo '</div>';
                   ?>
                   </body>
       ```
   
 * Do you have suggestion for fixing this and making the plugin check for the language
   of the post/product and use the “if $currentlang…” definitions in the template
   file?
 * Thank you in advance!
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [eavinu](https://wordpress.org/support/users/eavinu/)
 * (@eavinu)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/get_template_part-issue/#post-5794128)
 * Chouby one thing that I forgot to mention is that there is no problem in Explorer!
   
   I only see this problem in Firefox and Chrome which is very strsnge…

Viewing 1 replies (of 1 total)

The topic ‘get_template_part issue’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [eavinu](https://wordpress.org/support/users/eavinu/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/get_template_part-issue/#post-5794128)
 * Status: not resolved