Untitled
raw download clone
TEXT
views 22
,
size 1626 b
function na_get_gallery_image_urls( $post_id ) {
    global $wpdb, $linker_sluger, $ling, $slugerr, $tester;
    $post = get_post($post_id);


    // Make sure the post has a gallery in it
    if( ! has_shortcode( $post->post_content, 'gallery' ) )
        return;



    // Retrieve all galleries of this post
    $galleries = get_post_galleries_images( $post );
    $title = get_the_title($post_id);
    
    //$poster_guid = $wpdb->get_results("SELECT guid from wp_posts WHERE post_name LIKE ('albums-inside-%') ORDER BY guid DESC");
    echo '<h3>'. $title .'</h3>'; 
    
    
    
    // Loop through all galleries found
    foreach( $galleries as $gallery ) {
        // Loop through each image in each gallery
            foreach( $gallery as $image) {

                if(is_page( 376 )){
                    echo '<div class="single-image page-gallery col-md-12 col-sm-12">';
                    echo '<a href="'.$linker_sluger.'"><img src="'.$image.'"></a>';
                    echo '</div>';

                }

                elseif(is_page( 5 )){
                    echo '<div class="single-image page-home col-md-12 col-sm-12">';
                    echo '<img src="'.$image.'">';
                    echo '</div>';

                }

                else{
                    echo '<div class="single-image page-inside-gallery col-md-3 col-sm-12">';
                    echo '<a class="foobox" rel="gallery" href="'.$image.'"><img src="'.$image.'"></a>';
                    echo '</div>';  
   

                    }
            }
        }   
    }
close fullscreen
Login or Register to edit or fork this paste. It's free.