get_template_part shows correct results on single page, but not on archive

Question

I am using the houzez theme. The task is to show a template part (virtual tour) as a popup. The pop is fired by a button placed on the property card on the archive page. Everything is great and pop up works, but shows every time the same result. Besides that, the same code works perfectly on the single property page.

<?php
$virtual_tour = houzez_get_listing_data('virtual_tour');
    if( !empty( $virtual_tour ) ) { ?>
<div class="btn360">
    <button id="btn360" onclick="togglePopup()">Virtual Tour</button>
</div>

<div class="tour360" id="popup">
<div class="overlay360" id="overlay360" onclick="togglePopup()"></div>  
<div class="close-btn" onclick="togglePopup()">&times;</div>

<?php get_template_part('property-details/virtual-tour'); ?>

</div>  
<php}?>

What I am missing?

https://hexweb.net/oh/display-homes/

0
WPTricks 4 months 0 Answers 20 views 0

Leave an answer