| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/123answers.ca/public_html/regina/wp-content/themes/directorytheme/ |
Upload File : |
<?php acf_form_head(); ?>
<?php
/**
* template name: Listing
*/
get_header(); ?>
<!-- banner section -->
<div id="preloader"><div id="status"> </div></div>
<div id="page-banner" class="<?php if(get_field('banner')) : ?>has-banner<?php endif; ?>" style="background: <?php if(get_field('banner')) : ?>url('<?php the_field('banner'); ?>') no-repeat <?php the_field('bg_position'); ?> transparent;<?php endif; ?>;">
<div class="inner">
<h1><?php the_title(); ?></h1>
</div><!--inner-->
</div><!--page-banner-->
<!-- This code is used for serach listing.
Screenshort :https://prnt.sc/1uh5imm
-->
<section class="listing_search single-listing-search">
<div class="inner">
<?php
global $choices_array1;
global $business_nm,$add_nm,$listing_category;
if($_GET){
$business_nm = $_GET['listing_keyword'];
//echo $business_nm.'hello';
$add_nm = $_GET['add_listing_keyword1'];
//echo $add_nm.': add';
$listing_category = $_GET['s_listing_category'];
//echo $listing_category.': cat';
}
?>
<form id="single_listing_form">
<?php get_template_part( 'template-parts/dt/front', 'search-listing' ); ?>
</form>
</div>
</section>
<!-- This code is used for display all listing on page.
Screenshort : https://prnt.sc/1umeb7r -->
<section class="cp-section single-listing-wrap" style="padding-top: 0;">
<div class="inner">
<div id="listing_ajax">
<?php
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
if(!empty($_GET['listing_keyword'])){
$main_args = array(
'posts_per_page' => '30',
'paged' => $paged,
's' => sanitize_text_field(esc_attr($_GET['listing_keyword'])),
'post_type' => 'listings',
'post_status' => 'publish',
);
}else{
$main_args = array(
'post_type' => 'listings',
'posts_per_page' => '30',
'paged' => $paged,
'post_status' => 'publish',
);
}
if(!empty($_GET['s_listing_category'])){
$main_args['tax_query'] = array(
array(
'taxonomy' => 'listing-categories',
'terms' => sanitize_text_field(esc_attr($_GET['s_listing_category'])),
'field' => 'slug',
)
);
}
if(!empty($_GET['add_listing_keyword1'])){
$main_args['meta_query'] = array(
'relation' => 'AND',
array(
'key' => 'address',
'value' => sanitize_text_field(esc_attr($_GET['add_listing_keyword1'])),
'compare' => 'LIKE'
)
);
}
$fl = new WP_Query( $main_args );
if ( $fl->have_posts() ) : ?>
<div class="row">
<?php while ( $fl->have_posts() ) : $fl->the_post(); ?>
<div class="col-lg-4">
<div class="featured-listing">
<div class="fl-img">
<?php
$post_img = get_field('featured_image');
if (is_numeric($post_img)) {
$post_img = wp_get_attachment_url($post_img);
} else {
$post_img = get_field('featured_image');
}
$dtsimg=get_field('s_default_featured_image','option');
$ftdimg=get_the_post_thumbnail_url();
$post_id = get_the_ID();
?>
<div class="zioea"><a href="<?php the_permalink(); ?>"><img src="<?php
if(!empty($ftdimg)) { echo $ftdimg; }
else if(!empty($post_img)) { echo $post_img; }
else if(!empty($dtsimg)) { echo $dtsimg; }
else{ echo bloginfo("template_url").'/images/Listing-Placeholder.png'; }
?>" alt="<?php the_title(); ?>" class="img-fluid" /></a></div>
<h3><a href="<?php the_permalink(); ?>" class="list-title-click"><?php the_title(); ?></a></h3>
<!-- category shortcode-->
<div class="col-md-12 category_display" style="padding : 0;">
<?php echo do_shortcode( '[displ_cat]' ); ?>
</div>
<?php if(get_field('listing_type') != $choices_array1[0] ) : ?>
<img src="<?php echo get_template_directory_uri(); ?>/images/star.png" class="premium-star" />
<?php endif; ?>
</div><!--fl-img-->
</div>
</div><!--col-->
<?php endwhile; wp_reset_query(); ?>
</div><!--row-->
<?php endif; ?>
<?php
if(function_exists('wp_pagenavi'))
{
wp_pagenavi( array( 'query' => $fl ) );
}
?>
</div><!--listing_ajax-->
</div><!--inner-->
<div id="loading-icon"></div><!--loading-->
</section>
<script>
jQuery('#cp-container img').addClass('img-fluid');
jQuery(window).load(function(){
var business_nm = "<?php echo $business_nm; ?>";
var add_nm = "<?php echo $add_nm; ?>";
var listing_category = "<?php echo $listing_category; ?>";
if(business_nm != '' || add_nm != '' || listing_category != ''){
document.getElementById("listing_keyword").value = business_nm;
document.getElementById("listing_address").value = add_nm;
jQuery("#listing_category option[value='"+listing_category+"']").prop('selected', true);
//document.getElementById("keyword-search").click();
}
});
</script>
<?php get_footer();