Subscribe via RSS Feed

ThickBox

ThickBox is a WordPress plugin that adds the lightbox functionality to images in your posts. You can download it from the WordPress site. I found a little hack was necessary to get it to work as I didn’t fully understand the instructions provided on the author’s website.

After installing and activating the plugin the lightbox effect wasn’t working and after a little investigation I noticed that the Javascript and CSS files weren’t referenced (looked at the page source). To get round this I added the following directly into the header.php file for the template I’m using (tags removed to prevent code from being parsed on this page):

src=”http://yourdomain.com/pathto/thickbox/jquery.js” type=”text/javascript”
src=”http://yourdomain.com/pathto/thickbox.js” type=”text/javascript”
link rel=”stylesheet” href=”http://yourdomain.com/pathto/thickbox.css” type=”text/css” media=”all”

I inserted the code between these two tags:

wp_head()
/head

All now seems to work ok.

I also posted a comment on the author’s website yesterday and he got back to me today to advise what the problem was and how to resolve it.

Hope this helps somebody out.

As you have to manually amend the image tags I’ve only added the effect to the RD posting for now but will be updating a few other postings as time permits.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Diigo
  • E-mail this story to a friend!
  • Live
  • MySpace
  • Propeller
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Buzz

Related posts:

  1. Yotophoto – search for free-to-use images

Tags: , , ,

Category: Dogs, Photography, Tech, Web

About the Author:

Comments (2)

Trackback URL | Comments RSS Feed

  1. Hi everybody,
    you don’t have to add the CSS and JavaScript manually – the plugin will do this for you. All you have to do is to put ThickBox compliant markup inside a post/page and add a custom field namend “thickbox”. This video shows you how to do that.

    Hope that helps.

    Currently it’s not possible to add a ThickBox to your theme, i.e. in your header, sidebar or footer. If you want to do that you’ll have to add the CSS and JavaScript to your theme as described in this post.

  2. mmd says:

    Hi Christian,

    Thanks for your post and the clarification – the video was a big help.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.