• I’ll try to be as clear as possible.

    I am creating a theme where the main page will be the focus, avoiding the use of single pages (single.php). It’s kind of portfolio, where there are several blocks on the homepage of various sizes, and a gallery of images (the first) is used as the main image of this block. To retrieve the first image using the following function code:

    <img src="<?php bloginfo('template_url'); ?>/thumb.php?src=<?php
    $args = array(
    'post_type' => 'attachment',
    'numberposts' => 1,
    'post_mime_type' => 'image',
    'post_parent' => $post->ID
    );
    $images = get_posts( $args );
    foreach($images as $image):
    echo wp_get_attachment_url($image->ID, 'full');
    endforeach; ?>&w=<?php if($bloco == 'medio') { ?>295<?php } elseif ($bloco == 'maior') { ?>610<?php } else { ?>295<?php } ?>&h=356&q=100&zc=1" class="modal" />

    Sorry for code spam, but I need to set the width while posting in a custom field, so this timthumb resize width for the block.

    I also use a link with the same function, wp_get_attachment_url, to get the url of the image and open it in a lightbox.

    My problem is: I would like you to click this first image, WordPress returned this lightbox with other images of the post. The first image appears in Lightbox, the other with a navigation inside the lightbox. You can do this in index.php?

    Excuse me if I was not very clear, but my English is horrible and the explanation seems a bit confusing even to me ^^
    thanks 🙂

  • The topic ‘Get all gallery for lightbox while in home’ is closed to new replies.