Viewing 1 replies (of 1 total)
  • Thread Starter aGDm_Thabang

    (@agdm_thabang)

    Sorry Here`s the code, Thanx in advanced.

    <?php
    $args = array(
        'post_parent'    => $post->ID,
        'post_type'      => 'attachment',
        'post_mime_type' => 'image',
        'order'          => 'ASC',
        'orderby'        => 'menu_order',
        'numberposts'    => 4,
        'post_status'    => null,
    );
    
    $attachments = get_children($args);
    
    if ( $attachments ) :
    
        foreach ( $attachments as $attachment ) :
    
        ?>
    
        <div class="uk-width-small-1-2 uk-width-medium-1-4 id-<?php echo $post->ID; ?>">
            <a href="<?php echo $attachment->guid; ?>" data-uk-lightbox="{group:'post-id-<?php echo $post->ID; ?>'}">
                <?php echo wp_get_attachment_image( $attachment->ID, 'small-thumbnail', false );; ?>
            </a>
        </div>
    
        <?php
    
        endforeach;
    
    endif;
    ?>

Viewing 1 replies (of 1 total)

The topic ‘WordPress gallery cache’ is closed to new replies.