Skip to content

Commit 9f2f72b

Browse files
authored
Merge pull request #841 from wpdev10/master
allow to change view for listings tab and fix issue of displaying com…
2 parents 6e3402f + 36b90a2 commit 9f2f72b

1 file changed

Lines changed: 51 additions & 25 deletions

File tree

includes/libraries/class-geodirectory-plugin.php

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -883,8 +883,7 @@ public function add_profile_favorites_tab_content( $user ) {
883883
*
884884
* @return void
885885
*/
886-
public function add_profile_gd_lists_tab_content($user)
887-
{
886+
public function add_profile_gd_lists_tab_content($user) {
888887

889888
if (!class_exists('GeoDir_Lists')) {
890889
return;
@@ -1024,20 +1023,28 @@ class="uwp-profile-tab-sub-ul-count uwp-profile-sub-ul-gd-<?php echo esc_attr($t
10241023
<div class="col-sm p-0 uwp-loop-posts-title">
10251024
<h3><?php echo esc_html($title); ?></h3>
10261025
</div>
1026+
<div class="col p-0 d-sm-block uwp-loop-posts-toolbar">
1027+
<div class="btn-toolbar justify-content-end" role="toolbar" aria-label="Toolbar with button groups">
1028+
<?php geodir_list_view_select('gd_list'); ?>
1029+
</div>
1030+
</div>
10271031
</div>
10281032
</div>
10291033
<?php do_action('uwp_profile_posts_loop_wrap_start', $args, $found_posts); ?>
1030-
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
1031-
<?php
1032-
while ($the_query->have_posts()) : $the_query->the_post();
1033-
echo geodir_get_template_html("bootstrap/content-listing.php", array(
1034-
'column_gap_class' => $template_args['column_gap_class'],
1035-
'row_gap_class' => $template_args['row_gap_class'],
1036-
'card_border_class' => $template_args['card_border_class'],
1037-
'card_shadow_class' => $template_args['card_shadow_class'],
1038-
));
1039-
endwhile;
1040-
?>
1034+
<div class="geodir-loop-container">
1035+
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
1036+
<?php
1037+
while ($the_query->have_posts()) : $the_query->the_post();
1038+
echo geodir_get_template_html("bootstrap/content-listing.php", array(
1039+
'column_gap_class' => $template_args['column_gap_class'],
1040+
'row_gap_class' => $template_args['row_gap_class'],
1041+
'card_border_class' => $template_args['card_border_class'],
1042+
'card_shadow_class' => $template_args['card_shadow_class'],
1043+
));
1044+
endwhile;
1045+
wp_reset_postdata();
1046+
?>
1047+
</div>
10411048
</div>
10421049
<?php
10431050
do_action('uwp_profile_pagination', $the_query->max_num_pages);
@@ -1338,20 +1345,31 @@ public function get_bootstrap_listings( $user, $post_type ) {
13381345
<div class="col-sm p-0 uwp-loop-posts-title">
13391346
<h3><?php echo esc_html( $title ); ?></h3>
13401347
</div>
1348+
<div class="col p-0 d-sm-block uwp-loop-posts-toolbar">
1349+
<div class="btn-toolbar justify-content-end" role="toolbar" aria-label="Toolbar with button groups">
1350+
<?php
1351+
geodir_list_view_select($post_type);
1352+
?>
1353+
</div>
1354+
</div>
13411355
</div>
13421356
</div>
1343-
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
1344-
<?php
1345-
while ( $the_query->have_posts() ) : $the_query->the_post();
1346-
echo geodir_get_template_html( "bootstrap/content-listing.php", array(
1347-
'column_gap_class' => $template_args['column_gap_class'],
1348-
'row_gap_class' => $template_args['row_gap_class'],
1349-
'card_border_class' => $template_args['card_border_class'],
1350-
'card_shadow_class' => $template_args['card_shadow_class'],
1351-
) );
1352-
endwhile;
1353-
?>
1354-
</div>
1357+
<div class="geodir-loop-container">
1358+
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
1359+
<?php
1360+
while ( $the_query->have_posts() ) : $the_query->the_post();
1361+
echo geodir_get_template_html( "bootstrap/content-listing.php", array(
1362+
'column_gap_class' => $template_args['column_gap_class'],
1363+
'row_gap_class' => $template_args['row_gap_class'],
1364+
'card_border_class' => $template_args['card_border_class'],
1365+
'card_shadow_class' => $template_args['card_shadow_class'],
1366+
'template_part' => $template_args['card_shadow_class'],
1367+
) );
1368+
endwhile;
1369+
wp_reset_postdata();
1370+
?>
1371+
</div>
1372+
</div>
13551373
<?php
13561374
do_action( 'uwp_profile_pagination', $the_query->max_num_pages );
13571375
}
@@ -1800,8 +1818,14 @@ public function get_bootstrap_favorites($user, $post_type)
18001818
<div class="col-sm p-0 uwp-loop-posts-title">
18011819
<h3><?php echo esc_html($title); ?></h3>
18021820
</div>
1821+
<div class="col p-0 d-sm-block uwp-loop-posts-toolbar">
1822+
<div class="btn-toolbar justify-content-end" role="toolbar" aria-label="Toolbar with button groups">
1823+
<?php geodir_list_view_select($post_type); ?>
1824+
</div>
1825+
</div>
18031826
</div>
18041827
</div>
1828+
<div class="geodir-loop-container">
18051829
<div class="row row-cols-1 row-cols-sm-2 geodir-category-list-view <?php echo esc_attr( $gd_layout_class ); ?>">
18061830
<?php
18071831
while ($the_query->have_posts()) : $the_query->the_post();
@@ -1812,8 +1836,10 @@ public function get_bootstrap_favorites($user, $post_type)
18121836
'card_shadow_class' => $template_args['card_shadow_class'],
18131837
));
18141838
endwhile;
1839+
wp_reset_postdata();
18151840
?>
18161841
</div>
1842+
</div>
18171843
<?php
18181844
do_action('uwp_profile_pagination', $the_query->max_num_pages);
18191845
}

0 commit comments

Comments
 (0)