HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpprm/wp-content/themes/ronneby/templates/post-gallery.php
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }

global $dfd_ronneby;
$image_crop = isset($dfd_ronneby['thumb_image_crop']) ? $dfd_ronneby['thumb_image_crop'] : '';
if ($image_crop == "") {$image_crop = true;}
?>


<?php
	global $post;
	$postid = get_the_ID();
	
/*
    $args = array(
        'order' => 'ASC',
        'post_type' => 'attachment',
        'post_parent' => $postid,
        'post_mime_type' => 'image',
        'post_status' => null,
        'numberposts' => -1,
    );

    $attachments = get_posts($args);*/
	if (metadata_exists('post', $postid, '_my_post_image_gallery')) {
		$my_posts_image_gallery = get_post_meta($postid, '_my_post_image_gallery', true);
	} else {
		// Backwards compat
		$attachment_ids = get_posts('post_parent=' . $postid . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids');
		$attachment_ids = array_diff($attachment_ids, array(get_post_thumbnail_id()));
		$my_posts_image_gallery = implode(',', $attachment_ids);
	}

	$attachments = array_filter(explode(',', $my_posts_image_gallery));
    if ($attachments) {
		echo '<div class="dfd-gallery-cover">';
			echo '<div class="dfd-gallery-post-slider slide-post">';

				foreach ($attachments as $attachment) {
					$img_url =  wp_get_attachment_url($attachment); /*get img URL*/

					if (isset($dfd_ronneby['post_thumbnails_width']) && isset($dfd_ronneby['post_thumbnails_height']) && $dfd_ronneby['post_thumbnails_width'] && $dfd_ronneby['post_thumbnails_height']){
						$article_image = dfd_aq_resize($img_url, $dfd_ronneby['post_thumbnails_width'], $dfd_ronneby['post_thumbnails_height'], $image_crop, true, true);
					} else {
						$article_image = dfd_aq_resize($img_url, 900, 600, $image_crop, true, true);
					}
					if(!$article_image) {
						$article_image = $img_url;
					}
					?>
					<div>
						<img src="<?php echo esc_url($article_image); ?>" alt="<?php the_title(); ?>"/>
					</div>

				<?php  }
			echo '</div>';
			echo '<div class="dfd-gallery-bar"></div>';
			echo DFD_Carousel::controls();
			echo	'<script type="text/javascript">
						(function($) {
							if(typeof $.fn.initGallery !== "undefined") {
								$(".dfd-gallery-post-slider").initGallery();
							}
						})(jQuery);
					</script>';
        echo '</div>';
    }
?>