• Resolved John

    (@johnstevenspendleton)


    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

    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; 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)
  • Moderator bcworkz

    (@bcworkz)

    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

    (@johnstevenspendleton)

    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

    (@bcworkz)

    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

    (@johnstevenspendleton)

    Nice tip, thank you!

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

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