Title: aGDm_Thabang's Replies | WordPress.org

---

# aGDm_Thabang

  [  ](https://wordpress.org/support/users/agdm_thabang/)

 *   [Profile](https://wordpress.org/support/users/agdm_thabang/)
 *   [Topics Started](https://wordpress.org/support/users/agdm_thabang/topics/)
 *   [Replies Created](https://wordpress.org/support/users/agdm_thabang/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/agdm_thabang/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/agdm_thabang/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/agdm_thabang/engagements/)
 *   [Favorites](https://wordpress.org/support/users/agdm_thabang/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [[gallery] WordPress gallery cache](https://wordpress.org/support/topic/wordpress-gallery-cache/)
 *  Thread Starter [aGDm_Thabang](https://wordpress.org/support/users/agdm_thabang/)
 * (@agdm_thabang)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/wordpress-gallery-cache/#post-6696358)
 * 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)