• Hi, I wasn’t sure which section to put this but as it’s about hacking up the gallery with tweaks I thought I’d put it here. Basically in media.php I’ve changed the columns and a few other small changes but I was wondering how would I get the gallery function to link to the file itself? Or perhaps be able to change the page the gallery links to so it displays full sized images? Or even better put rel links in there for lightbox?

    Any help would be appreciated, thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • I agree.

    Clicking a photo to go to another page and then clicking the photo to see it full size is a real PITA. I’m sure someone knows how to tweak it.

    Please?

    I think this guy has got it doing something similar to what you are looking for.

    https://paulstamatiou.com/2008/03/29/wordpress-25-gallery-test

    Yes, please. Some more documentation for changing the way [gallery] works!

    Thread Starter neilb

    (@neilb)

    Thanks! I didn’t know there was an image.php as a template – probably because I’m an idiot. Now off to do stupid things in dumb ways.

    I still wish there was more ways to tweak the gallery and where images link but this will work for now. ??

    Idiot #2 here. ??

    Thanks for the info!

    I’ve been trying to accomplish the same thing, ie get the gallery link to link to the image itself. I think I found where the [gallery] shortcode is defined : wp-includes/media.php, line 333. The target of the link is being defined in line 394 apparently :

    $link = wp_get_attachment_link($id, $size, true);

    I haven’t had time to figure out how to replace this with the url of the image itself..

    in wp-includes/post-template.php, i altered the wp_get_attachment_link function so that my images link to the files and not to an image page.

    on line 382, i changed

    $url = get_attachment_link($_post->ID);

    to

    $url = wp_get_attachment_url($_post->ID);

    not sure if there is a better way to do it ? but this is a start..

    So, this is my solution for a WP-gallery. Not the best, but as bkuzma said – a start.

    on line 382, i changed

    $url = get_attachment_link($_post->ID);

    to

    $url = wp_get_attachment_url($_post->ID);

    Ah, thanks! I’ve been wanting to figure out how to do this. I wish there were a nicer, less hack-ish way to go about it, but this will work for now. Couldn’t figure out how to do it with a plugin.

    In version 2.5.1 not work ??

    As a matter of fact, that hack works in 2.5.1

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Tweaking the new gallery feature in 2.5’ is closed to new replies.