From 76759b11e3233809a0ced8be5d936c0fc29dc2e9 Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 10:37:36 +0700 Subject: [PATCH] uapte --- inc/property/class-opalestate-shortcodes.php | 43 ++++++++++++++++---- templates/shortcodes/properties.php | 29 ++++++++++--- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/inc/property/class-opalestate-shortcodes.php b/inc/property/class-opalestate-shortcodes.php index 1357bb78..fbb0029e 100755 --- a/inc/property/class-opalestate-shortcodes.php +++ b/inc/property/class-opalestate-shortcodes.php @@ -67,19 +67,48 @@ class OpalEstate_Shortcodes { */ public function search_properties_form ( $atts=[] ) { - $atts = is_array( $atts ) ? $atts : []; + $atts = is_array( $atts ) ? $atts : []; + $layout = 'collapse-advanced'; + + $default = array( + 'hidden_labels' => true, + 'display_more_options' => true, + 'nobutton' => false, + 'layout' => $layout + ); - $atts['hidden_labels'] = true; + $atts = array_merge( $default, $atts ); - return opalestate_load_template_path( 'search-box/collapse-advanced', $atts ); + return opalestate_load_template_path( 'search-box/'.$layout, $atts ); } - public function properties() { - return opalestate_load_template_path( 'shortcodes/properties' ); + /** + * Display all properties follow user when logined + */ + public function properties( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = array ( + 'posts_per_page' => 10, + 'show_pagination' => true, + 'column' => apply_filters( 'opalestate_properties_column_row', 3 ), + 'layout' => 'content-property-grid-v2' + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/properties', $atts ); } - public function search_properties_result() { - return opalestate_load_template_path( 'shortcodes/search-properties-result' ); + /** + * [opalestate_search_properties_result] Display all properties follow user when logined + */ + public function search_properties_result( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + + return opalestate_load_template_path( 'shortcodes/search-properties-result', $atts ); } /** diff --git a/templates/shortcodes/properties.php b/templates/shortcodes/properties.php index 635a16a5..19be584d 100644 --- a/templates/shortcodes/properties.php +++ b/templates/shortcodes/properties.php @@ -1,22 +1,39 @@ -1, + 'posts_per_page' => $posts_per_page, ]; $query = Opalestate_Query::get_property_query( $args ); $class = 'column-item'; +$clscol = floor( 12 / $column ); + ?>
have_posts() ): ?> - have_posts() ) : $query->the_post(); ?> -
- -
- +
+ have_posts() ) : $query->the_post(); ?> + +
+ +
+ +
+ + max_num_pages > 1 && $show_pagination ): ?> +
max_num_pages ); ?>
+ +