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


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.

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

<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'); ?>


What I am missing?

WPTricks 4 months 0 Answers 20 views 0

Leave an answer