Forums

[resolved] open images in posts like the media library (3 posts)

  1. Everton
    Member
    Posted 9 months ago #

    Hi

    My title isn't the best, but this is what I want to do. When a user clicks on an images in a post e.g. this post:

    http://www.windows7news.com/2011/08/08/dvblink-share-tv-cards-pcs-online/

    when they click on the dvblogic image:

    http://www.windows7news.com/wp-content/uploads/2011/08/dvblogic.jpg

    I want this url to be displayed:

    http://www.windows7news.com/2011/08/08/dvblink-share-tv-cards-pcs-online/dvblogic-2/

    which is the one generated by the media library in the dashboard when you click 'view'.

    Is this possible in WP, or do I need a plugin?

    Thanks

    EB

  2. duck__boy
    Member
    Posted 9 months ago #

    When you display images in a Post through your Gallery you should be given 3 opions for the Link - None, File URL or Post URL. Selecting 'File URL' should give you what you want.

    Failing that, if you are adding the images through a tamplate, try $image_url = wp_get_attachment_image_src( $attachment_id, $size, $icon ). This will return an array with the image src attrubutes in it - see the Function Reference for more information.

    Thanks.

  3. Everton
    Member
    Posted 9 months ago #

    lol that simple.

    Thanks

Reply

You must log in to post.

About this Topic

Tags