Skip to content

Commit

Permalink
Merge pull request #2743 from kprajapatii/master
Browse files Browse the repository at this point in the history
GD > Post Images option "Show limit" uses incorrect width for first slide on mobile - FIXED
  • Loading branch information
kprajapatii authored Dec 4, 2024
2 parents c276118 + 3e12e10 commit bd94aca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ __WARNING: GDv2 is a significant update over GDv1 and may require manual work, s
= GeoDirectory v2.8.91 - TBD =
* Multiple maps on the page shows JavaScript error - FIXED
* A-Z Search links don't removes page params on paginated links - FIXED
* GD > Post Images option "Show limit" uses incorrect width for first slide on mobile - FIXED

= GeoDirectory v2.3.90 - 2024-11-30 =
* Load scripts on call feature can break block theme add listing page map - FIXED
Expand Down
27 changes: 15 additions & 12 deletions templates/bootstrap/images/images.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see https://docs.wpgeodirectory.com/article/346-customizing-templates/
* @package GeoDirectory/Templates
* @version 2.3.60
* @version 2.8.91
*/

defined( 'ABSPATH' ) || exit;
Expand Down Expand Up @@ -45,7 +45,7 @@
* @var string $responsive_image_class
*/

global $gd_post, $aui_bs5, $geodir_carousel_open;
global $ayecode_ui_settings, $gd_post, $aui_bs5, $geodir_carousel_open;

$the_post = $gd_post;

Expand All @@ -69,14 +69,6 @@
<?php
}

$inner_wrapper_class = '';
if ( $type == 'slider' || $type == 'image' ) {
$limit_show_row = '';
$inner_wrapper_class = ( ! $geodir_carousel_open ? 'carousel-inner ' : '' ) . $limit_show_row;
} else if ( $type == 'gallery' || $type == 'masonry' ) {
$inner_wrapper_class = 'row row-cols-1 row-cols-md-3 g-2';
}

$image_total = count( (array) $post_images );

if ( $limit_show > 0 && $limit_show > $image_total ) {
Expand All @@ -85,6 +77,17 @@

$image_count = 0;
$max_width_percent = $limit_show ? 100 / absint( $limit_show ) : '';
$inner_wrapper_class = '';

if ( $type == 'slider' || $type == 'image' ) {
$inner_wrapper_class = ( ! $geodir_carousel_open ? 'carousel-inner ' : '' );

if ( $max_width_percent > 0 && ! ( ! empty( $ayecode_ui_settings ) && is_callable( array( $ayecode_ui_settings, 'is_block_editor' ) ) && ( $ayecode_ui_settings->is_block_editor() || $ayecode_ui_settings->is_block_content_call() ) ) ) {
$max_width_percent = '';
}
} else if ( $type == 'gallery' || $type == 'masonry' ) {
$inner_wrapper_class = 'row row-cols-1 row-cols-md-3 g-2';
}

// Image cover class
if ( $type == 'masonry' ) {
Expand Down Expand Up @@ -112,9 +115,9 @@

if ( $type == 'slider' || $type == 'image' ) {
if ( $geodir_carousel_open ) {
echo '<div ' . ( $image_count == 0 && $limit_show ? 'style="width:' . (float) $max_width_percent . '%"' : '' ) . '>';
echo '<div ' . ( $image_count == 0 && $limit_show && $max_width_percent ? 'style="width:' . (float) $max_width_percent . '%"' : '' ) . '>';
} else {
echo '<div class="carousel-item' . ( $image_count == 0 ? ' active' : '' ) . '"' . ( $image_count == 0 && $limit_show ? ' style="width:' . (float) $max_width_percent . '%"' : '' ) . '>';
echo '<div class="carousel-item' . ( $image_count == 0 ? ' active' : '' ) . '"' . ( $image_count == 0 && $limit_show && $max_width_percent ? ' style="width:' . (float) $max_width_percent . '%"' : '' ) . '>';
}
} else if( $type == 'gallery' ) {
echo '<div class="col' . ( $aui_bs5 ? '' : ' mb-4' ) . '"' . ( $limit_show && $image_count >= $limit_show ? ' style="display:none"' : '' ) . '><div class="card m-0 p-0 overflow-hidden">';
Expand Down

0 comments on commit bd94aca

Please sign in to comment.