<?php
$post_id = get_the_id();
// echo print_r(get_vehicle_gallery_images());
$image_urls = get_post_meta($post_id, 'pictures', true);
if (is_string($image_urls)) {
$images = explode(',', $image_urls);
} elseif (is_array($image_urls)) {
$images = $image_urls;
} else {
$images = [];
}
if (!empty($images)): ?>
<div class="vehicle-gallery">
<?php foreach ($images as $index => $img_url): ?>
<a href="<?php echo esc_url(trim($img_url)); ?>" class="glightbox" data-gallery="vehicle-gallery">
<?php if ($index === 0): ?>
<img src="<?php echo esc_url(trim($img_url)); ?>" alt="Vehicle Image" class="gallery-main-image" />
<?php else: ?>
<img src="<?php echo esc_url(trim($img_url)); ?>" alt="Gallery Thumb" class="gallery-thumb" />
<?php endif; ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
document.addEventListener('DOMContentLoaded', function () {
new Swiper('.vehicle-gallery', {
slidesPerView: 5,
spaceBetween: 10,
loop: true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 3,
},
480: {
slidesPerView: 2,
}
}
});
});
Pre-Owned
BMW MY20 sDRIVE18d M SPORT STEPTRONIC (2021)
R 499 000
Description
Motorplan 2026,05,19 *Alpine White *Leathertec Black *19" M Double spoke *Automatic tailgate *Rear view camera *Panorama glass *Park Distance Control front & rear *Extended Light Package *Park Assist *Hi Fi loudspeaker *Smartphone Integration *Comfort telephony *Edition NEXT 3.0
Mileage
63939 km
Year
Fuel Type
DIESEL
Exterior Colour
Alpine White III
Transmission
AUTOMATIC
VIN
Vehicle ID
28481333
Features
Range
X1
Mileage
63 939 km
Year
2021
Colour
Alpine White III
Transmission
AUTOMATIC
Fuel
DIESEL
Body Type
STATION WAGON
Doors
5
Service History
Full
Vin No.
WBA52AC0X05T57512
Comments
Motorplan 2026,05,19 *Alpine White *Leathertec Black *19" M Double spoke *Automatic tailgate *Rear view camera *Panorama glass *Park Distance Control front & rear *Extended Light Package *Park Assist *Hi Fi loudspeaker *Smartphone Integration *Comfort telephony *Edition NEXT 3.0
<?php
$post_id = get_the_id();
$custom_fields = get_post_meta($post_id);
echo $custom_fields['mmcode'][0] . '<br />';
echo print_r($custom_fields);
if (empty($custom_fields)) {
error_log("No custom fields found for post ID: $post_id");
return;
}
error_log("Custom fields for post ID $post_id:");
foreach ($custom_fields as $key => $value) {
// $value is always an array
if (is_array($value)) {
foreach ($value as $val) {
error_log("$key => $val");
}
} else {
error_log("$key => $value");
}
}
?>Back to search results
R 499 000
MSRP
Call Now
Available from BMW Centurion
2023 Lenchen Ave S, Centurion Central, Centurion, 0157, South Africa
Back to search results
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_8.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_9.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_10.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_11.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_12.jpg
USED
2019
80 500 km
AUTOMATIC
UNLEADED
White
R 379 950
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_8.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_9.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_10.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_11.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_12.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_13.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_14.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_15.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_16.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01609_u114167_17.jpg
USED
2019
58 500 km
AUTOMATIC
UNLEADED
Mineral Grey Metallic
R 429 000
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_8.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_9.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_10.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_11.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_12.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_13.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_14.jpg
USED
2020
53 500 km
AUTOMATIC
UNLEADED
Alpine White III
R 439 000
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_8.jpg
USED
2023
66 571 km
AUTOMATIC
DIESEL
Pure White
R 649 950

