Gallery Bug in WordPress 3.5.1
There is a bug in the gallery function that’s built into WordPress 3.5.1. You should be able to choose what the thumbnail image links to (either the media file or an attachment page), however the choice is not respected when the gallery is inserted.
For my themes that have a lightbox, that causes an error that says you need to specify a size.
There is a WordPress Track Ticket about this problem should be fixed for 3.5.2. Until then here is a workaround so you can link to the file.
- Create your gallery as normal and insert it into your page/post.
- Switch from the Visual editor to the “Text” editor by clicking the tab in the top right of your main content box.
- Locate your gallery in your post. It will look something like this:
- Delete the closing
]and replace it with this:
- That will make your complete gallery look something like this:
- Publish or update your post
That should be a workaround until the fix is added to the WordPress core.
I’ve learned that if you toggle the drop-down that lets you choose between attachment page and file for the link back and forth, it will let the link to the file actually work. You might give that a try too if you’d rather not edit the shortcode directly.