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!
- The topic ‘get_template_part issue’ is closed to new replies.