Title: Display Gallery name
Last modified: August 20, 2016

---

# Display Gallery name

 *  [MasterNs](https://wordpress.org/support/users/frile/)
 * (@frile)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/display-gallery-name/)
 * I’m trying to display a Gallery name by adding some code to …/views/default/gallery.
   php (line 92) but no luck for now… Anyone can help?
 *     ```
       <div id="information">
       <h2><?php echo $gallery_title; ?></h2>
       <h3></h3>
       <p ></p>
       </div>
       ```
   
 * Thanks
 * [http://wordpress.org/extend/plugins/slideshow-gallery/](http://wordpress.org/extend/plugins/slideshow-gallery/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [MasterNs](https://wordpress.org/support/users/frile/)
 * (@frile)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/display-gallery-name/#post-3315776)
 * I can list all Gallery names this way:
 *     ```
       <div id="information">
       <h2>
       <?php if ($galleries = $this -> Gallery -> gname()) : ?>
       <?php foreach ($galleries as $gallery_id => $gallery_title) : ?>
       <?php echo $gallery_title; ?>
       <?php endforeach; ?>
       <?php endif; ?>
       </h2>
       <h3></h3>
       <p ></p>
       </div>
       ```
   
 * where gname() is function from …/models/gallery.php :
 *     ```
       function gname() {
       $gname = array();
       if ($galleries = $this -> find_all()) {
       foreach ($galleries as $gallery) {
       $gname[$gallery -> id] = $gallery -> title;
       			}
       		}
       return $gname;
       	}
       ```
   
 * But how to select just active (current) Gallery title?

Viewing 1 replies (of 1 total)

 The topic ‘Display Gallery name’ is closed to new replies.

 * ![](https://ps.w.org/slideshow-gallery/assets/icon-256x256.png?rev=1187457)
 * [Slideshow Gallery LITE](https://wordpress.org/plugins/slideshow-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/slideshow-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/slideshow-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/slideshow-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/slideshow-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/slideshow-gallery/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [MasterNs](https://wordpress.org/support/users/frile/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/display-gallery-name/#post-3315776)
 * Status: not resolved