Jump to content

Reloading JS attached to shortcodes

Recommended Posts


Hi I'm using ajax to load pages on my site but I am also using the Facebook like button short code http://support.pagelines.me/docs/miscellaneous/shortcodes/

I need to reload the JS associated with this short code as the Facebook like button disappears when the page is loaded with JS. Could anyone assist me on the location of the file containing the JS? I have the reload code all figured out but I just need the file location.

Any assistance would be much appreciated.

Here's my homepage


Link to a post where it will display normally on first load


If you click through to a couple of posts you will notice the like button no longer shows up, it seems to display the first load of a page but if you keep clicking through posts it stops.

The button should be displayed to the left of the following text beneath the post content 'Click like to get the latest music news, hottest tracks and more via Facebook.'

Share this post

Link to post
Share on other sites

I see the problem, which isn't a problem at all.


If someone has already liked your page, then the FB button greys out. If they have not liked it yet, it's blue.  As someone who's liked the page already, it appears grey to you.  If you unlike it, the button will be blue again.  Meanwhile your visitors who are seeing the page for the first time will see it blue.


It's actually working as it should, as Facebook doesn't allow multiple 'likes' from any one person.

Former PageLines Moderator, Food Expert and Raconteur

Share this post

Link to post
Share on other sites

Thanks for the reply but I know that's supposed to happen, which it does. However the button disappears completely due to ajax stripping the JS away, I have had to reload a couple of other plugis due to ajax doing to same thing and I just need to find the file where the shortcode draws its JS from so I can reload that file with the page load.
If you click through more than 1 post you will see the Facebook button disappear completely greyed out or not.

Share this post

Link to post
Share on other sites

Well, the js is inline, if you look at that area of the page you can see it. Maybe the facebook code is designed like that to stop automated bots from mass liking pages.Just a thought, maybe a question for the facebook dev forums?

Share this post

Link to post
Share on other sites

Thanks for the assistance. I’ve had to use the facebook iframe method of implementing a like button instead of using the pagelines shortcode.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • werdnags
      By werdnags+
      I know this does not have anything to do with Pagelines directly but this is happening on my PL5 site.  At the bottom of my blog posts I have put the Facebook Comments Plugin and it works well but when people are leaving comments they are the same for every post.  Does anyone have any idea on how to solve this so the comments are for the post they are on.  Does that make sense? Ha!
      Thanks for any ideas folks.
    • MissT
      By MissT+
      Regarding the 'global option' mentioned by Simon in this previous post (to turn off the facebook opengraph data if you are using another plugin that provides it) ...where is this option? I don't seem to be able to find it.
      Many thanks in advance.
    • JudithKlinger
      By JudithKlinger+
      I'm sure this is just user fatigue...but where is the setting to delete the Facebook button in the Splash section of Teamwork? You'd think it would be in the Splash area, but it seems
      to be hiding elsewhere!  You can barely see it... I didn't even notice it until I changed the image. 

    • Perry
      By Perry+
      Hello there,
      We have started experiencing a crippling issue within the last few days. It seems that ever since three days ago the CSS will not load for our pages outside of the DMS editor. Inside of the editor everything appears to be looking fine, but after publishing and viewing the page in a new browser our elements are all over the place, and in the console it appears that there is an error stating that the CSS did not get loaded. Looking through FTP, it seems that the two CSS files in the pagelines folder in wp-content are now missing. We did not access this folder or modify any files prior to this.  What kind of problem could this be? We are totally halted on any work we can perform until this is solved, so any help would be greatly appreciated. 
      An example of the phenomenon: http://datesafe2.21thirteenhost.com/category/ask-mike/
    • Jeffrey Salim
      By Jeffrey Salim+
      When trying to activate the Facebook Plugin, using the Bootstrap Theme under Platform 5, the following Fatal Error occurs:
      Parse error: syntax error, unexpected '[', expecting ')' in /wp-content/plugins/pl-plugin-login-facebook/libs/fblogin.php on line 35
      If anyone has any advice, it would be greatly appreciated...