Title: Nextgen 2.0.76 path error
Last modified: August 22, 2016

---

# Nextgen 2.0.76 path error

 *  Resolved [xguimera](https://wordpress.org/support/users/xguimera/)
 * (@xguimera)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/)
 * I have been using next function to recover galleries:
 * <?php global $nggdb;
    $gallery2 = $nggdb->get_gallery (‘homepage’, ‘sortorder’,‘
   ASC’, true, 0, 0); foreach($gallery2 as $image) { ?> <div><img alt=”<?php bloginfo(‘
   name’);?>” src=”<?php echo $image->imageURL;?>”/></div><?php } ?>
 * I migrated the website to a new server and installed new Nextgen Version and 
   now I found next:
 * 1. ‘homepage’ name does not work. I have to put gallery id to receive information.
   
   2. $image->imageURL returns website path/image_name and not gallery path.
 * Anyone can help?
 * thank you
 * [https://wordpress.org/plugins/nextgen-gallery/](https://wordpress.org/plugins/nextgen-gallery/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [xguimera](https://wordpress.org/support/users/xguimera/)
 * (@xguimera)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834242)
 * restored to 2.0.66.37 and works again.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834263)
 * [@xguimera](https://wordpress.org/support/users/xguimera/) – I would suspect 
   you will still need to use the gallery ID and the issue with `imageURL` was resolved
   with version 2.0.76
 * Thanks!
 * – Cais.
 *  Thread Starter [xguimera](https://wordpress.org/support/users/xguimera/)
 * (@xguimera)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834267)
 * With version 2.0.76 if I use gallery ID instead of gallery name I get error… 
   and also if I use imageURL with gallery ID I get path error.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834272)
 * [@xguimera](https://wordpress.org/support/users/xguimera/) – Can you provide 
   a Gist or pastebin of the entire related code so what you are referencing can
   be taken in its proper context?
 * – Cais.
 *  Thread Starter [xguimera](https://wordpress.org/support/users/xguimera/)
 * (@xguimera)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834282)
 * I attach link to website under construction…
    [http://www.stand-box.com/clients/implanta](http://www.stand-box.com/clients/implanta)
 * At homepage I call to gallery with next function and nothing is returned
 * <?php global $nggdb; $gallery2 = $nggdb->get_gallery (‘homepage’, ‘sortorder’,‘
   ASC’, true, 0, 0);foreach($gallery2 as $image) { ?>
    <div><img alt=”<?php bloginfo(‘
   name’);?>” src=”<?php echo $image->imageURL;?>”/></div><?php } ?>
 * Also in Projects – Offices – Google Offices I call to gallery with gallery ID
   and path returned is not ok
 * <?php $enlace = get_post_meta($post->ID, ‘galeria’, true); ?>
    <?php global $
   nggdb; $gallery2 = $nggdb->get_gallery ($enlace, ‘sortorder’, ‘ASC’, true, 0,
   0);foreach($gallery2 as $pic) { ?> <div><img alt=”<?php bloginfo(‘name’); wp_title();?
   >” src=”<?php echo $pic->imageURL; ?>”/></div><?php } ?>
 * Expect this will help.
 * regards
 * xavi
 *  [Benjamin](https://wordpress.org/support/users/benjaminowens/)
 * (@benjaminowens)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834492)
 * Thanks for your report! I’ve committed a fix that should fix your problem; we
   recently made an update that broke nggdb::get_gallery()’s search by slug. I can’t
   say exactly when this will be released (but we do hope it will be soon), if you’d
   like to upgrade to .76 you can fix this by altering nextgen-gallery/products/
   photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php and replacing line 125’s `
   $image_mapper->select()->where(array("galleryid = %d", $id));` with
 *     ```
       if (is_numeric($id))
           $image_mapper->select()->where(array("galleryid = %d", $id));
       else
           $image_mapper->select()->where(array("slug = %s", $id));
       ```
   
 *  Thread Starter [xguimera](https://wordpress.org/support/users/xguimera/)
 * (@xguimera)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834508)
 * Perfect!!!
 * Thank you

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Nextgen 2.0.76 path error’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [xguimera](https://wordpress.org/support/users/xguimera/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/nextgen-2076-path-error/#post-5834508)
 * Status: resolved