Before you ask please READ THIS

image name and url

edited October 2013 in Hypershot Posts: 7
Hi Air,

Can you please tell me in the "single-album.php" how I can get the name and url of the currently displayed image?

I am trying to make a few modifications and I am at a loss since WP is all new to me.
Any help will be appreciated.

Thanks
Iraj

Comments

  • AirAir
    Posts: 10,970
    You can't get it in single-album.php as there you only receive collection of images/video. Check function a13_make_collection in advance/cpt-album.php

    With regards.
  • Posts: 7
    Thanks Air, let me rephrase that... In the single-album.php you are absolutely correct it gets passed the collection and the php doesn't really know what image is being displayed at any given time. However, in javascript or somewhere when user clicks one of the AddThis shared icons obviously it knows which image is the current one otherwise it wouldn't have been able to get the link to pass to the socials. Would you know where I could look for such a code or would you be able to let me know if there is a javascript variable I can check? I know this is support that is not covered, so if it takes a lot of time I do understand and don't worry about it... I will eventually figure it out :)

    Thanks
    Iraj
  • AirAir
    Posts: 10,970
    IN function I wrote about you can see $link = get_attachment_link($attachment_id); - this is link to attachment page of this image. This link is passed to JavaScript for shearing. If you don't like it then few lines above you have $link = $media;(link to big image file), so you can use this instead.

    With regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion