diff --git a/includes/model/Listings.php b/includes/model/Listings.php index d868b3410c..f4d2a26178 100644 --- a/includes/model/Listings.php +++ b/includes/model/Listings.php @@ -1282,11 +1282,20 @@ public function render_list_view( $post_ids ) { } foreach ( $post_ids as $listing_id ) { - ?> -
- loop_template( 'list', $listing_id ); ?> -
- +
+ loop_template( 'list', $listing_id ); ?> +
+ loop_template( 'list', $listing_id ); + endif; } } @@ -1297,11 +1306,35 @@ public function render_grid_view( $post_ids ) { } foreach ( $post_ids as $listing_id ) { - ?> -
+ + $is_slider = apply_filters( + 'directorist_listings_grid_items_view_before', + false, + $this + ); + + $default_wrapper_class = ''; + ob_start(); + Helper::directorist_column( $this->columns ); + $default_wrapper_class = trim( ob_get_clean() ); + + $grid_item_wrapper_class = apply_filters( + 'directorist_listings_grid_item_wrapper_class', + $default_wrapper_class, + $this + ); + + $has_grid_item_wrapper = ( ! $is_slider && '' !== trim( (string) $grid_item_wrapper_class ) ); + + if ( $has_grid_item_wrapper ) : ?> +
+ + loop_template( 'grid', $listing_id ); ?> -
- +
+ display_preview_image ) ? 'loop-list' : 'loop-list-nothumb'; Helper::get_template( 'archive/' . $template, [ 'listings' => $this ] ); } - + wp_reset_postdata(); } diff --git a/templates/archive/grid-view.php b/templates/archive/grid-view.php index f6da8c3f97..8ba59b60ba 100644 --- a/templates/archive/grid-view.php +++ b/templates/archive/grid-view.php @@ -16,13 +16,19 @@ have_posts() ) : ?> - -
- - render_grid_view( $listings->post_ids() ) ?> - + has_masonry() ? 'directorist-masonry' : '' ) . ' ' . $row_class; + ?> +
+ render_grid_view( $listings->post_ids() ) ?>
- show_pagination && 'numbered' === $listings->options['pagination_type'] ) { diff --git a/templates/archive/list-view.php b/templates/archive/list-view.php index 8e75fb166e..564173f725 100644 --- a/templates/archive/list-view.php +++ b/templates/archive/list-view.php @@ -16,24 +16,20 @@ have_posts() ) : ?> - -
- render_list_view( $listings->post_ids() ) ?> -
-
- - show_pagination && 'numbered' === $listings->options['pagination_type'] ) { - - do_action( 'directorist_before_listings_pagination' ); - - $listings->pagination(); - - do_action( 'directorist_after_listings_pagination' ); - } - ?> - - + +
+ render_list_view( $listings->post_ids() ) ?> +
diff --git a/templates/archive/loop-grid.php b/templates/archive/loop-grid.php index 18810cd02a..7991f12f7f 100644 --- a/templates/archive/loop-grid.php +++ b/templates/archive/loop-grid.php @@ -6,7 +6,6 @@ */ if ( ! defined( 'ABSPATH' ) ) exit; - $loop_fields = $listings->loop['card_fields']['template_data']['grid_view_with_thumbnail']; ?>