Recently I upgraded this blog to the new WordPress Version (something you should do as well) and I realized that it messed up my galleries. Every image was linked to an own attachment page:

Every time someone clicks the images, there would be a seperate page, instead of a fancyzoom popup. Here is what you can do to set up the gallery function to not use attachment pages for images:

  1. Go to the wp-includes folder and open up media.php
  2. In the media.php file search for line 663 (Update: from WordPress 2.8.1 on it is line 684) which says the following

    $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);

  3. Change this to:

    $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, false, false);

  4. Don’t forget to save it. Then upload the new media.php into your wp-inlcudes folder online.

Now your images should be linked to themselves again, like this:


Trackback? If you liked this article, subscribe for more updates.