<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
if ( ! empty( $templateid ) ) {
	?>
	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
		<div class="post-list-content">		
	<?php
		$templateid = apply_filters( 'wpml_object_id', $templateid, 'elementor_library', true );
	if ( ! $templateid ) {
		return;
	}
	if ( 'publish' !== get_post_status( $templateid ) ) {
		$return = esc_html__( 'Template Not Yet Published.', 'essential-classy-addons-for-elementor' );
	} else {
		$return = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $templateid );
	}

		echo $return;
	?>
		</div>
	</article>
	<?php
} else {
	echo esc_html__( 'Select a Template for Loop', 'essential-classy-addons-for-elementor' );
}
?>