• Hy, I am having problems with WordPress gallery, i got this code that gets attachments from a post so i can output the images differently, it works fine but when i make changes to the posts gallery in the admin panel, it either does not show the new changes or just shows the images i first posted.

    I don’t know why it does that, please help me out :(..and this is my first post on WordPress[loving WordPress!!] :)..

    https://ww.wp.xz.cn/plugins/gallery/

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.