function display_image_gallery_shortcode($atts) {
// Set up default attributes for the shortcode
$atts = shortcode_atts(
array(
'pod_name' => 'dogs', // Replace with your actual pod name
'field_name' => 'dog_gallery', // Replace with your actual image field name
),
$atts,
'image_gallery'
);
// Get the Pod
$gallery = pods($atts['pod_name']);
// Start the output buffer to return the HTML
ob_start();
// Check if there are any items in the Pod
if ($gallery->total() > 0) {
// Start the gallery container
echo '
';
// Loop through the Pod items
while ($gallery->fetch()) {
// Get the list of image URLs (space-separated)
$image_urls = $gallery->field($atts['field_name']);
// Split the string into an array of image URLs
$image_array = explode(' ', $image_urls); // Split by space
// Loop through the image array and display each image
foreach ($image_array as $image_url) {
// Display each image in a gallery item
echo '
';
}
// Return the gallery HTML
return ob_get_clean();
}
// Register the shortcode
add_shortcode('image_gallery', 'display_image_gallery_shortcode');
Welcome
https://oir.ewb.mybluehost.me/
Mon, 20 Jan 2025 18:04:36 +0000en-US
hourly
1 https://wordpress.org/?v=7.1.2241537277Hello world!
https://oir.ewb.mybluehost.me/hello-world/?utm_source=rss&utm_medium=rss&utm_campaign=hello-world
https://oir.ewb.mybluehost.me/hello-world/#commentsMon, 20 Jan 2025 18:04:36 +0000http://box4300/cgi/addon_GT.cgi?s=GT::WP::Install::Cpanel+%28oirewbmy%29+-+127.0.0.1+%5Bnocaller%5D/?p=1Welcome to WordPress. This is your first post. Edit or delete it, then start writing!