Forums

How to use this: get_the_attachment_link? (2 posts)

  1. hilj
    Member
    Posted 4 months ago #

    Hello,

    I'm just building a site which displays thubnails (when opened) via attachemt.php.

    I pretty much have this in my attachement.php file:

    <?php $attachment_link = get_the_attachment_link($post->ID, true, array(600, 800)); // This also populates the iconsize for the next line ?>
    		<?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? 'full' : '') . 'attachment'; // This lets us style narrow icons specially ?>

    I'm having trouble to find any info about how to use this?

    I'd also liked the image to be a link to a next image rather than link to the actual image.

    If some nice person could point me to a tutorial or explain this?

    Thanks a lot!

  2. MichaelH
    moderator
    Posted 4 months ago #

    Looks like you should be trying to use wp_get_attachment_image_src instead.

    See wp-includes/media.php (line 500 in 2.8) for details on that function.

    Related:
    http://codex.wordpress.org/Template_Tags/wp_get_attachment_link

Reply

You must log in to post.

About this Topic