Title: Adding custom button code to a simple lightbox link
Last modified: August 21, 2016

---

# Adding custom button code to a simple lightbox link

 *  Resolved [John](https://wordpress.org/support/users/johnstevenspendleton/)
 * (@johnstevenspendleton)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/)
 * My question,
 * I am trying to add a custom button to a simple lightbox link
 * If you look at the link below and switch to LIST VIEW(look at the second listing
   called “Drag and Drop”) you can see the button is rendering but the words that
   are supposed to be on the button are next to it and not on the button.
 * [http://www.johnpendleton.com/jpportfolio/portfolio/#prettyPhoto](http://www.johnpendleton.com/jpportfolio/portfolio/#prettyPhoto)
 * **Code that I am using for the button:**
 * a href=”[http://www.johnpendleton.com/jpportfolio/wp-content/uploads/2013/10/parallax-background-quasar.jpg&#8221](http://www.johnpendleton.com/jpportfolio/wp-content/uploads/2013/10/parallax-background-quasar.jpg&#8221);
   rel=”prettyPhoto” title=”This is the description”><img src=”[rockthemes_button
   icon_align=”left” icon_title=”View Larger Image” button_size=”” button_color=”
   primary” button_flat=”no” button_shape=”button-rounded” button_wrap=”no” link_url
   =”” icon_class=”icon-check” icon_url=””]View Larger Image[/rockthemes_button]”/
   >
 * Any help on what I need to change to get this to work would be great!
 * Thanks,
 * JP

Viewing 4 replies - 16 through 19 (of 19 total)

[←](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/?output_format=md)
[1](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/?output_format=md)
2

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/page/2/#post-4459253)
 * Yes, I got it 🙂 I know what’s wrong, it’s my fault. I made the same mistake 
   that I warned you about in my first post! Lost in nested quotes. Sorry about 
   that 🙁
 * Variables are only expanded inside of double quoted strings. There’s lots of 
   double quotes there, but none are delimiting the string, they are all part of
   the HTML. We need to concatenate variables into the string when using single 
   quote delimiters. This should take care of things:
    `" rel="prettyPhoto[' . $
   gallery_name . ']">`,
 * My fingers are crossed there’s nothing else wrong with this!
 *  Thread Starter [John](https://wordpress.org/support/users/johnstevenspendleton/)
 * (@johnstevenspendleton)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/page/2/#post-4459254)
 * Ha! please do not be sorry. This worked and I am all set, thank you so much for
   all of your effort and time!!!!!!!!!
 * If you go back to that link you can see my first post that I am creating for 
   my new site. I just need to now figure out where to comment out the “details”
   button and I will be all set.
 * Thanks again
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/page/2/#post-4459260)
 * You’re most welcome! I feel better now that I know it’s all working.
 * At least commenting out code is less likely to break something unanticipated.
   I would have thought the details button would have been close to where you inserted
   your own button. I know enough about themes to know it could also reside an a
   completely different file.
 * Figuring out which template certain content is coming from can be a challenge.
   I’ve often resorted to inserting a HTML comment near the start of the content
   of all potential templates which identifies the filename. Then when you view 
   the page source with context highlighting the comments stand out and delineate
   where each template’s content starts.
 *  Thread Starter [John](https://wordpress.org/support/users/johnstevenspendleton/)
 * (@johnstevenspendleton)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/page/2/#post-4459261)
 * Nice tip, thank you!

Viewing 4 replies - 16 through 19 (of 19 total)

[←](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/?output_format=md)
[1](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/?output_format=md)
2

The topic ‘Adding custom button code to a simple lightbox link’ is closed to new
replies.

## Tags

 * [Custom button](https://wordpress.org/support/topic-tag/custom-button/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 19 replies
 * 2 participants
 * Last reply from: [John](https://wordpress.org/support/users/johnstevenspendleton/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/adding-custom-button-code-to-a-simple-lightbox-link/page/2/#post-4459261)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
