Forums

[Plugin: NextGEN Gallery] "Featured Image" in a gallery (3 posts)

  1. exit6
    Member
    Posted 2 years ago #

    Is there any way to display the first image in a gallery large and the rest as thumbnails? Closest I've managed to do was this:

    [singlepic id=1 w=780 h=452 float=]
    [nggallery id=1]

    That looks right on the page, but the large image is duplicated (it's the first image in the gallery), and the single image is a different shutterset than the gallery.

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. exit6
    Member
    Posted 2 years ago #

    bump

  3. exit6
    Member
    Posted 2 years ago #

    I seem to be on my own here but I'm laying this out in case anyone else is trying this.

    I have half a solution here, but I'm not a good enough php guy to do the whole thing. Here's what I've got so far, any help would be great:

    Disabled the link on a single image by pulling it out of singlepic.php.

    Made a custom field named "featuredImage" on the post and put the shortcode for the image there.

    In single.php, do:

    <?php if (have_posts()) : while (have_posts()) : the_post();
    $custom_field_featuredImage =
    get_post_meta($post->ID, 'featuredImage', true);?>

    and in the spot where I want it:
    <?php echo do_shortcode($custom_field_featuredImage); ?>

    So that adds the image to the page without using the main content field. I was trying hard to avoid using custom fields so as to make this site totally idiot proof, but I can't see any other solution.

    Next to set up the image box link, which is where I got stuck. I made another custom field called "galleryNumber," which I use in the a tag like this:
    <a rel="gallery[set_<?php echo $custom_field_galleryNumber; ?>]" class="lightview"
    Which fits the syntax of the image box I'm using. So that tells the image box that this image is part of the gallery. It works (I know it's a hack..), but I'm stuck at the href.

    So if anyone happened to read this far, any idea how to get the URL for the singlepic image? In singlepic.php he does it like this:
    href="<?php echo $image->imageURL ?>"But that doesn't work in single.php (of course).

    Then the hard part, I need to find a way to pull the gallery id and use it in the lightbox link.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.