I have the following code on my site.

<?php // image gallery content 
if( has_shortcode( $post->post_content, 'gallery' ) ) {                     
    $gallery = get_post_gallery_images( $post->ID );


    $image_list="<ul id="cfImageGallery">";                       
    foreach( $gallery as $image ) {// Loop through each image in each gallery
        $image_list .= '<li><img src="https://wordpress.stackexchange.com/questions/120544/" . str_replace('-150x150','',$image) . "https://wordpress.stackexchange.com/questions/120544/" /></li>';
    }
    $image_list .= '</ul>';                     
    echo $image_list;                       
}                         
?>

My problem is that get_post_gallery_images returns thumbs files instead of fill size so Im using the str_replace function to solve it.

How can I make to retrieve the full size urls?

Thanks

2 s
2

If you’re working within a template file, this code should work. However, I didn’t test it.

<?php echo do_shortcode(''); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *