0

First post here so let me know if I'm doing something wrong.

The company I work for uses a custom FancyBox Wordpress plugin that allows us to use fancy box on images easily. Basically, when you click on the image it expands to fill the center of the screen. Standard stuff, however we're having a problem.

Since last week or so it has stopped working and the images just link to themselves (takes you to a new page with he image on a white background). This isn't ideal for obvious reasons, and the developer isn't in the country for the foreseeable future so I can't ask him to fix it.

I've looked through the plugin files and the source code for the pages that are output, and the javascript isn't being called properly. It looks like this in the page source:

<script type="text/javascript">jQuery.wpxFancybox();</script>

The main plugin file responsible for this output appears to be this (paste bin link).

I'm alright with PHP but this is beyond me. I would really appreciate your help with this problem.

Let me know if you require the code from any other files in the plugin. I'll be happy to supply them.

Thanks in advance guys.

4
  • 1
    This looks like a Javascript Error. Did you check the Console on your Browser to see if any Errors occur?
    – fischi
    Commented Feb 6, 2013 at 12:09
  • Ah! Just checked and it says this. Commented Feb 6, 2013 at 12:17
  • Did you also update your WordPress installation or any other Plugins? Can you please post a link to the Site?
    – fischi
    Commented Feb 6, 2013 at 12:19
  • The site is lguess.co.uk. It's been updated to WP 3.5 recently, but I couldn't tell you if any plugins have been updated, I don't have a record of it. Commented Feb 6, 2013 at 12:23

1 Answer 1

1

The Problem is that you include jQuery 1.9, in which the jQuery.browser was removed. Look at your functions.php, you will find a line in there saying wp_register_script or wp_enqueue_script with the parameter 'jquery'.

The URL you are loading jQuery from is 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', and you have to change it to 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'.

Please ask your developer to update your Fancyboxscript when he returns to your country :)

5
  • Thank you so much. I changed it myself (Im good with HTML & CSS, and learning PHP). It was in the header file. Changed the URL and it fixed it. I really appreciate you helo fischi, thanks a lot :) Commented Feb 6, 2013 at 12:47
  • No problem. You should really ask your developer to stick to the WordPress way of including scripts and files here, so you are much safer regarding such issues. Have a nice time!
    – fischi
    Commented Feb 6, 2013 at 12:49
  • How would it work the Wordpress way? He's left for NZ for possibly a year, so I'm taking over any small scale development. What would you recommend as a way to include it? (If you have time to answer that is!) I appreciate your time :) Commented Feb 6, 2013 at 12:55
  • Look into wp_enqueue_script, and use wp_head in your header.php. Get a little used to this - and do not try this stuff on your live website ;) Be Part of the community, and it will work out fine with the time. We are here to help if you are stuck :)
    – fischi
    Commented Feb 6, 2013 at 12:58
  • Ah yes I see. I've used that before. I'll look into it further. Still have lots to learn. Thanks again for the help, I really appreciate it. Commented Feb 6, 2013 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.