Fill in the Blank
Member
Posted 1 year 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?
Fill in the Blank
Member
Posted 1 year 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?
Fill in the Blank
Member
Posted 1 year 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?
Fill in the Blank
Member
Posted 1 year ago #
Fill in the Blank
Member
Posted 1 year 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.