Quote:
Originally Posted by AdultSites
Find it in the database, and change it there.
|
Never even touch the WP database directly! Use API to alter it. In this particular case, you need to go through all existing posts, find the gallery shortcodes there and alter them according to this scheme:
[gallery] - linked to attachment
[gallery link="file"] - linked to file
[gallery link="none"] - not linked
Let's consider that all your gallery thumbnails are linked to attachments and you want to make them liked to the actual images. In other words, you have to replace this:
[gallery]
with this:
[gallery link="file"]
I'll show how to do it with the
CyberSEO plugin, which almost all GFY's already have.
- Go to "CyberSEO->Tools"
- Find the "PHP Code <?php .. ?>" box and put there the following code:
Code:
$post->post_content = str_replace('[gallery]', '[gallery link="file"]', $post->post_content);
- Click "Apply These Modifications To All Existing Posts"
- Done!
If you want to do the opposite (i.e. make all the thumbnails to link to attachments instead of original images), you should use this code in step #3:
Code:
$post->post_content = str_replace('[gallery link="file"]', '[gallery]', $post->post_content);
Very simple, isn't it? And no special plugins needed