Title: Gallery Title / PHP
Last modified: August 21, 2016

---

# Gallery Title / PHP

 *  [lilsammy](https://wordpress.org/support/users/lilsammy/)
 * (@lilsammy)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/gallery-title-php/)
 * Hi all, I am trying to find out if its possible to get the gallery title in PHP
   from within say a template file.
 * Currently I am trying to get a breadcrumb working for gallery pages and the only
   way I have managed to do it thus far is:
 *     ```
       <div class="breadcrumbs">
                   <a href="<?php echo get_bloginfo('url') ?>">Home</a>
                   >
                   <?php if($url == "www.manorproperty.info/build/gallery/"){ ?>
       			<span class="current">Gallery</span>		
   
       			<?php } else { ?>
                   <a href="<?php echo get_bloginfo('url') ?>/gallery/">Gallery</a>
       			>
                   <span class="current">
                   <?php
       				$pieces = explode("/", $url);
       				$num = (substr_count($url, "/") - 1);
       				$string = $pieces[$num];
       				$string = str_replace("-"," ",$string);
   
       				echo ucwords($string);
       			?>
                   </span>
                   <?php } ?>
               </div>
       ```
   
 * Now this works to some extend but when I have galleries with names that contain
   things like & and , because the SEO friendly link wont have these in its causing
   me big hassle.
 * So I really need to try to find a way of getting the actual gallery name to make
   my breadcrumb but I don’t know how to get it from outside the nextgen plugin 
   files.
 * [http://wordpress.org/extend/plugins/nextgen-gallery/](http://wordpress.org/extend/plugins/nextgen-gallery/)

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

 *  Thread Starter [lilsammy](https://wordpress.org/support/users/lilsammy/)
 * (@lilsammy)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/gallery-title-php/#post-3788872)
 * Anyone know how I can achieve the breadcrumb I am trying to do?
 *  Thread Starter [lilsammy](https://wordpress.org/support/users/lilsammy/)
 * (@lilsammy)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/gallery-title-php/#post-3788919)
 * Still looking for a solution to this.

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

The topic ‘Gallery Title / PHP’ 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/)

 * 2 replies
 * 1 participant
 * Last reply from: [lilsammy](https://wordpress.org/support/users/lilsammy/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/gallery-title-php/#post-3788919)
 * Status: not resolved