Title: Insert Template into archive-product.php
Last modified: March 20, 2019

---

# Insert Template into archive-product.php

 *  Resolved [modkid](https://wordpress.org/support/users/modkid/)
 * (@modkid)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/insert-template-into-archive-product-php/)
 * I use
 * echo do_shortcode(‘ [elementor-template id=”24938″] ‘);
 * to insert custom templates into say: my product archive. Which works great, but
   im now eager to start using Polylang and I can’t figure out how to make it show
   the right template for the right language.
 * Template A – English only
    Template B – Dutch only
 * Anyone know the right trigger to let the site figure out when to show which template?
 * I’ve already tried something with
 * // [polylang lang=”en”]English[/polylang][polylang lang=”de”]Deutsch[/polylang]
   //
   Add this code in your functions.php function polylang_shortcode($atts, $content
   = null) { if (empty($content)) return ”; extract( shortcode_atts( array(‘lang’
   => ”), $atts ) ); if (empty($lang)) return “### You must specify ‘lang’ using
   shortcode: polylang”; return ($lang == pll_current_language()) ? $content : ”;}
   add_shortcode(‘polylang’, ‘polylang_shortcode’);
 * But I can’t figure out how to make it show the elementor template when the page
   is viewed in a certain language.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [modkid](https://wordpress.org/support/users/modkid/)
 * (@modkid)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/insert-template-into-archive-product-php/#post-11337281)
 * I did some digging and came up with the following:
 * if( get_locale() == ‘en_US’) {
    echo do_shortcode(“[elementor-template id=’TEMPLATE
   NUMBER A’]”); } if( get_locale() == ‘nl_NL’) { echo do_shortcode(“[elementor-
   template id=’TEMPLATE NUMBER B’]”); }
 * Seems to work. =) !
    -  This reply was modified 7 years, 1 month ago by [modkid](https://wordpress.org/support/users/modkid/).
 *  Plugin Contributor [Brad Johnson](https://wordpress.org/support/users/p4fbradjohnson/)
 * (@p4fbradjohnson)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/insert-template-into-archive-product-php/#post-11343208)
 * Thanks for your feedback.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Insert Template into archive-product.php’ is closed to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [Brad Johnson](https://wordpress.org/support/users/p4fbradjohnson/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/insert-template-into-archive-product-php/#post-11343208)
 * Status: resolved