2019-09-10 06:27:33 +02:00
|
|
|
<?php
|
|
|
|
global $post;
|
|
|
|
|
2019-10-04 11:26:23 +02:00
|
|
|
$agency_id = get_the_ID();
|
|
|
|
$limit = apply_filters( 'opalesate_agency_properties_limit', 5 );
|
|
|
|
$user_id = get_post_meta( $agency_id, OPALESTATE_AGENCY_PREFIX . 'user_id', true );
|
2019-09-10 06:27:33 +02:00
|
|
|
|
2019-10-04 11:26:23 +02:00
|
|
|
$query = Opalestate_Query::get_agency_property( $agency_id, $user_id, $limit );
|
2019-09-10 06:27:33 +02:00
|
|
|
|
2019-10-04 11:26:23 +02:00
|
|
|
if ( $query->have_posts() ) :
|
|
|
|
$id = rand();
|
|
|
|
?>
|
|
|
|
<div class="clearfix clear"></div>
|
|
|
|
<div class="opalestate-box-inner property-agency-section">
|
|
|
|
<h4 class="box-heading hide"><?php echo sprintf( esc_html__( 'My Properties', 'opalestate-pro' ), $query->found_posts ); ?></h4>
|
2020-03-23 05:13:53 +01:00
|
|
|
<div class="ajax-load-properties" data-paged="1" data-type="agency" data-id="<?php echo get_the_ID(); ?>">
|
|
|
|
<div class="opalestate-rows">
|
|
|
|
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>" id="<?php echo esc_attr( $id ); ?>">
|
|
|
|
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
|
|
|
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
|
|
|
<?php echo opalestate_load_template_path( 'content-property-list-v2' ); ?>
|
|
|
|
</div>
|
|
|
|
<?php endwhile; ?>
|
2019-10-04 11:26:23 +02:00
|
|
|
</div>
|
2020-03-23 05:13:53 +01:00
|
|
|
<?php if ( $query->max_num_pages > 1 ): ?>
|
|
|
|
<div class="w-pagination"><?php opalestate_pagination( $query->max_num_pages ); ?></div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2019-10-04 11:26:23 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-10 06:27:33 +02:00
|
|
|
<?php else : ?>
|
2019-10-04 11:26:23 +02:00
|
|
|
<div class="opalestate-message">
|
2020-03-23 05:13:53 +01:00
|
|
|
<?php esc_html_e( 'The agency has not any property yet.', 'opalestate-pro' ); ?>
|
2019-10-04 11:26:23 +02:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2019-09-10 06:27:33 +02:00
|
|
|
|
2019-10-04 11:26:23 +02:00
|
|
|
<?php wp_reset_postdata(); ?>
|