WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] BROKEN RECORD : Gallery Link on Random Image display (5 posts)

  1. Fill in the Blank
    Member
    Posted 3 years ago #

    Hey everyone,

    I have looked through the forum and I see a lot of people wanting to link their images to the associated gallery. I am having a hard time doing this. I am using the function <?php echo nggShowRandomRecent('random',6,'home'); ?> to display 6 images randomly and using my custom theme gallery-home.php. The problem I face is that it uses galleryID of 0 to use ALL galleries in the query so it will never give me the proper ID associated with each image. Does anyone have a work around?

  2. Fill in the Blank
    Member
    Posted 3 years ago #

    Well I am using $picturelist[$key]->pagelink = get_permalink( $gallery->pageid ); around line 358 in nggfunctions.php and it works but only for the first image that it pulls. I am not great with OOP in PHP so I am not quite sure how to get the pageid from the gallery of each image. Any help?

  3. Fill in the Blank
    Member
    Posted 3 years ago #

    and I know in line 257 it is pulling the first image information in the array from this query $gallery->pageid = $first_image->pageid; . How can I get the pageid for each image?

  4. Fill in the Blank
    Member
    Posted 3 years ago #

    please?

  5. Fill in the Blank
    Member
    Posted 3 years ago #

    I don't know why it worked but changing it to:
    $picturelist[$key]->pagelink = get_permalink( $picture->pageid );

    did it... Thanks for nothing everyone out there :P

    I still love you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.