Title: [nextgen gallery] get_permalink(?)
Last modified: August 19, 2016

---

# [nextgen gallery] get_permalink(?)

 *  [surferbloggy](https://wordpress.org/support/users/surferbloggy/)
 * (@surferbloggy)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/nextgen-gallery-get_permalink/)
 * ciao! i have to call get_permalink funztion to get this url
 * [http://www.website.com/post_title.html?pid=18](http://www.website.com/post_title.html?pid=18)
 * I have the title of post and the id of photo
 *     ```
       $galleryID = stripslashes(nggGallery::i18n($picture->gid));
   
       	$gallerypage = $wpdb->get_var("SELECT pageid FROM $wpdb->nggallery WHERE gid = '$galleryID' ");
   
       	$post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE id = '$gallerypage' ");
       ```
   
 * this is the link I have to change:
 *     ```
       $out .= '<a href="' . $picture->imageURL . '" title="' . stripslashes(nggGallery::i18n($picture->description)) . '" ' . $thumbcode . ' >';
   
               $out .= '<img title="' . stripslashes(nggGallery::i18n($picture->alttext)) . '" alt="' . stripslashes(nggGallery::i18n($picture->alttext)) . '" src="' . $picture->thumbURL . '" />';
   
               $out .= '</a>' . "\n";
       ```
   
 * I tried so
 * `$out .= '<a href="' . get_permalink().'?pid='.stripslashes(nggGallery::i18n(
   $picture->pid)). '" title="' . stripslashes(nggGallery::i18n($picture->description)).'"'.
   $thumbcode . ' >';`
 * it links to the article if I compose the link it always change it to goto?pid
   =N
 * do you know which parameters i have to give to get_permalink function??

The topic ‘[nextgen gallery] get_permalink(?)’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [surferbloggy](https://wordpress.org/support/users/surferbloggy/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/nextgen-gallery-get_permalink/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
