Update templates

This commit is contained in:
Hoang Huu 2019-10-01 16:09:15 +07:00
parent d5bb6abe51
commit b762d7ec6c
4 changed files with 113 additions and 105 deletions

View File

@ -1,59 +1,62 @@
<?php <?php
$settings = $this->get_settings_for_display(); $settings = $this->get_settings_for_display();
$layout = $settings['item_layout']; $layout = $settings['item_layout'];
$attrs = $this->get_render_attribute_string( 'wrapper-style' ); $attrs = $this->get_render_attribute_string( 'wrapper-style' );
if( isset($_GET['display']) && $_GET['display'] == 'grid' ){ if ( isset( $_GET['display'] ) && $_GET['display'] == 'grid' ) {
$layout = 'grid'; $layout = 'grid';
}else if( isset($_GET['display']) && $_GET['display'] == 'list' ){ } elseif ( isset( $_GET['display'] ) && $_GET['display'] == 'list' ) {
$layout = 'list'; $layout = 'list';
$attrs = 'class="column-list"'; $attrs = 'class="column-list"';
} }
$onlyfeatured = 0; $onlyfeatured = 0;
if( isset($_GET['s_agents']) ) { if ( isset( $_GET['s_agents'] ) ) {
$query = Opalestate_Agency_Query::get_agencies( array("posts_per_page"=>$limit, 'paged' => $paged), $onlyfeatured ); $query = Opalestate_Agency_Query::get_agencies( [ "posts_per_page" => $limit, 'paged' => $paged ], $onlyfeatured );
} else { } else {
$query = Opalestate_Agency_Query::get_search_agencies_query(); $query = Opalestate_Agency_Query::get_search_agencies_query();
} }
$rowcls = apply_filters('opalestate_row_container_class', 'opal-row'); $rowcls = apply_filters( 'opalestate_row_container_class', 'opal-row' );
?> ?>
<?php if( $settings['enable_sortable_bar'] ): ?> <?php if ( $settings['enable_sortable_bar'] ): ?>
<div class="opalesate-archive-top"><div class="<?php echo $rowcls;?>"> <div class="opalesate-archive-top">
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="<?php echo esc_attr( $rowcls ); ?>">
<div class="collection-counter"> <div class="col-lg-6 col-md-6 col-sm-6">
<span><?php echo sprintf( esc_html__('Found %s Agency', 'opalestate-pro'), '<span class="text-primary">'.$query->found_posts.'</span>' ) ?></span> <div class="collection-counter">
</div> <span><?php echo sprintf( esc_html__( 'Found %s Agency', 'opalestate-pro' ), '<span class="text-primary">' . $query->found_posts . '</span>' ) ?></span>
</div> </div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right"> </div>
<div class="opalestate-sortable"> <div class="col-lg-6 col-md-6 col-sm-6 text-right">
<?php echo opalestate_render_sortable_dropdown(); ?> <div class="opalestate-sortable">
</div> <?php echo opalestate_render_sortable_dropdown(); ?>
<?php opalestate_show_display_modes(); ?> </div>
</div> <?php opalestate_show_display_modes(); ?>
</div></div> </div>
</div>
</div>
<?php endif; ?> <?php endif; ?>
<div class="agency-collection-wrap"> <div class="agency-collection-wrap">
<?php if( $query->have_posts() ): ?> <?php if ( $query->have_posts() ): ?>
<div class="agency-container"> <div class="agency-container">
<div <?php echo $attrs; ?>> <div <?php echo wp_kses_post( $attrs ); ?>>
<?php $cnt=0; while( $query->have_posts() ): $query->the_post(); ?> <?php $cnt = 0;
<div class="column-item "> while ( $query->have_posts() ): $query->the_post(); ?>
<?php echo opalestate_load_template_path( 'content-agency-'.$layout ); ?> <div class="column-item ">
</div> <?php echo opalestate_load_template_path( 'content-agency-' . $layout ); ?>
</div>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>
</div> </div>
<?php if( $query->max_num_pages ): ?> <?php if ( $query->max_num_pages ): ?>
<div class="w-pagination"> <div class="w-pagination">
<?php opalestate_pagination( $query->max_num_pages ); ?> <?php opalestate_pagination( $query->max_num_pages ); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<div class="agency-results"> <div class="agency-results">
<?php echo opalestate_load_template_path( 'content-no-results' ); ?> <?php echo opalestate_load_template_path( 'content-no-results' ); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>

View File

@ -1,62 +1,65 @@
<?php <?php
$settings = $this->get_settings_for_display(); $settings = $this->get_settings_for_display();
$layout = $settings['item_layout']; $layout = $settings['item_layout'];
$attrs = $this->get_render_attribute_string( 'wrapper-style' ); $attrs = $this->get_render_attribute_string( 'wrapper-style' );
if( isset($_GET['display']) && $_GET['display'] == 'grid' ){ if ( isset( $_GET['display'] ) && $_GET['display'] == 'grid' ) {
$layout = 'grid'; $layout = 'grid';
}else if( isset($_GET['display']) && $_GET['display'] == 'list' ){ } elseif ( isset( $_GET['display'] ) && $_GET['display'] == 'list' ) {
$layout = 'list'; $layout = 'list';
$attrs = 'class="column-list"'; $attrs = 'class="column-list"';
} }
$onlyfeatured = 0 ;
if( isset($_GET['s_agents']) ) { $onlyfeatured = 0;
$query = Opalestate_Query::get_agents( array("posts_per_page"=>$limit, 'paged' => $paged), $onlyfeatured );
} else {
$query = OpalEstate_Search::get_search_agents_query();
}
$form = $settings['search_form'] ? "search-agents-form-".$settings['search_form']: "search-agents-form"; if ( isset( $_GET['s_agents'] ) ) {
$rowcls = apply_filters('opalestate_row_container_class', 'opal-row'); $query = Opalestate_Query::get_agents( [ "posts_per_page" => $limit, 'paged' => $paged ], $onlyfeatured );
} else {
$query = OpalEstate_Search::get_search_agents_query();
}
$form = $settings['search_form'] ? "search-agents-form-" . $settings['search_form'] : "search-agents-form";
$rowcls = apply_filters( 'opalestate_row_container_class', 'opal-row' );
?> ?>
<?php if( $settings['enable_sortable_bar'] ): ?> <?php if ( $settings['enable_sortable_bar'] ): ?>
<div class="opalesate-archive-top"><div class="<?php echo esc_attr( $rowcls ); ?>"> <div class="opalesate-archive-top">
<div class="col-lg-6 col-md-6 col-sm-6"> <div class="<?php echo esc_attr( $rowcls ); ?>">
<div class="collection-counter"> <div class="col-lg-6 col-md-6 col-sm-6">
<span><?php echo sprintf( esc_html__('Found %s Agents', 'opalestate-pro'), '<span class="text-primary">'.$query->found_posts.'</span>' ) ?></span> <div class="collection-counter">
</div> <span><?php echo sprintf( esc_html__( 'Found %s Agents', 'opalestate-pro' ), '<span class="text-primary">' . $query->found_posts . '</span>' ) ?></span>
</div> </div>
<div class="col-lg-6 col-md-6 col-sm-6 text-right"> </div>
<div class="opalestate-sortable"> <div class="col-lg-6 col-md-6 col-sm-6 text-right">
<?php echo opalestate_render_sortable_dropdown(); ?> <div class="opalestate-sortable">
</div> <?php echo opalestate_render_sortable_dropdown(); ?>
<?php opalestate_show_display_modes(); ?> </div>
</div> <?php opalestate_show_display_modes(); ?>
</div></div> </div>
</div>
</div>
<?php endif; ?> <?php endif; ?>
<div class="agents-collection-wrap"> <div class="agents-collection-wrap">
<?php if( $query->have_posts() ): ?> <?php if ( $query->have_posts() ): ?>
<div class="agents-container"> <div class="agents-container">
<div <?php echo $attrs; ?>> <div <?php echo $attrs; ?>>
<?php $cnt=0; while( $query->have_posts() ): $query->the_post(); ?> <?php $cnt = 0;
<div class="column-item "> while ( $query->have_posts() ): $query->the_post(); ?>
<?php echo opalestate_load_template_path( 'content-agent-'.$layout ); ?> <div class="column-item ">
</div> <?php echo opalestate_load_template_path( 'content-agent-' . $layout ); ?>
</div>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>
</div> </div>
<?php if( $query->max_num_pages ): ?> <?php if ( $query->max_num_pages ): ?>
<div class="w-pagination"> <div class="w-pagination">
<?php opalestate_pagination( $query->max_num_pages ); ?> <?php opalestate_pagination( $query->max_num_pages ); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php else: ?> <?php else: ?>
<div class="agents-results"> <div class="agents-results">
<?php echo opalestate_load_template_path( 'content-no-results' ); ?> <?php echo opalestate_load_template_path( 'content-no-results' ); ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php wp_reset_postdata(); ?> <?php wp_reset_postdata(); ?>

View File

@ -15,7 +15,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
?> ?>
<div class="category-list-collection "> <div class="category-list-collection ">
<div <?php echo $attrs; ?>> <div <?php echo wp_kses_post( $attrs ); ?>>
<?php foreach ( $terms as $category ): ?> <?php foreach ( $terms as $category ): ?>
<?php <?php
$tax_link = get_term_link( $category->term_id ); $tax_link = get_term_link( $category->term_id );
@ -32,7 +32,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
} }
?> ?>
<div class="property-category-bg" <?php echo $style; ?>> <div class="property-category-bg" <?php echo wp_kses_post( $style ); ?>>
</div> </div>
<div class="static-content"> <div class="static-content">
<div class="property-category-info text-center"> <div class="property-category-info text-center">
@ -51,6 +51,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
'%1$s Property', '%1$s Property',
'%1$s Properties', '%1$s Properties',
$category->count, $category->count,
'count properties',
'opalestate-pro' 'opalestate-pro'
), ),
number_format_i18n( $category->count ) number_format_i18n( $category->count )

View File

@ -15,7 +15,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
?> ?>
<div class="city-list-collection "> <div class="city-list-collection ">
<div <?php echo $attrs; ?>> <div <?php echo wp_kses_post( $attrs ); ?>>
<?php foreach ( $terms as $city ): ?> <?php foreach ( $terms as $city ): ?>
<?php <?php
$tax_link = get_term_link( $city->term_id ); $tax_link = get_term_link( $city->term_id );
@ -32,7 +32,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
} }
?> ?>
<div class="property-city-bg" <?php echo $style; ?>> <div class="property-city-bg" <?php echo wp_kses_post( $style ); ?>>
</div> </div>
<div class="static-content"> <div class="static-content">
<div class="property-city-info text-center"> <div class="property-city-info text-center">
@ -51,6 +51,7 @@ $attrs = $this->get_render_attribute_string( 'wrapper-style' );
'%1$s Property', '%1$s Property',
'%1$s Properties', '%1$s Properties',
$city->count, $city->count,
'count properties',
'opalestate-pro' 'opalestate-pro'
), ),
number_format_i18n( $city->count ) number_format_i18n( $city->count )