Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:49:53+00:00 2026-06-05T04:49:53+00:00

I’m using PrettyPhoto lightbox for an image gallery. When the image pops up, Twitter

  • 0

I’m using PrettyPhoto lightbox for an image gallery. When the image pops up, Twitter and Facebook buttons appear under it. That’s built into the PrettyPhoto plugin, and it works fine.

The problem is, the Facebook button is the iframe kind (which doesn’t allow the user to enter a comment). I want to replace it with the HTML5 button (which opens a comment box when you click it, instead of just liking).

I want to replace this (standard FB code for iframe button):

<div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href='+pp_real_links[set_position]+'&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:23px;" allowTransparency="true"></iframe></div>

…with this (standard fb code for HTML5 like button):

<div class="fb-like" data-href="instagram.com/the-pic" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false">test text</div>

When I do the replacement, it doesn’t show up in the lightbox. It works anywhere else on the site though.

And yes, I replaced the prettyPhoto css code for .facebook with .fb-like. I also put text in the div to verify it’s showing up in the right place.

I think the root of the problem is that the social link code is defined in the JS; in the PrettyPhoto settings, there’s an attribute called ‘markup’ which stores the html for the lightbox and share buttons. So it’s probably not connecting with the FB JS code.

What’s the solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:49:54+00:00Added an answer on June 5, 2026 at 4:49 am

    The code you posted (the old iframe one) does not require the use of the facebook javascript sdk since it just loads the iframe.

    On the other hand, the html5 code you want to use does need the sdk to render it, you see the fb-like div is just a container in which the sdk inserts a new iframe.

    From your code I can’t say if you are loading the js sdk, if not then load/init it as described in the documentation, just be sure to include the xfbml attribute:

    FB.init({
        appId      : 'YOUR_APP_ID', // App ID
        channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
        status     : true, // check login status
        cookie     : true, // enable cookies to allow the server to access the session
        xfbml      : true  // parse XFBML
    });
    

    If you are already using the js sdk then it should work, unless the like button code is added dynamically after the sdk has finished loading and initializing.
    If that’s the case then just use the FB.XFBML.parse method:

    FB.XFBML.parse();
    
    // or you can pass the container element:
    FB.XFBML.parse(document.getElementById(ELEMENT_ID));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.