• first of all, pleas sorry my poor english!

    i have to know the http direction (link) to an image in a post to pass this to a swfobject as a param…

    i thought make a post with the image, title and a short comment; and give them to a swf as params with php: $title, $content, $category… ok? to make an animated presentation…

    post don’t appears… only the animation!

    but i can’t get a variable or function to get the image’s URL to do the same as the rest…

Viewing 2 replies - 1 through 2 (of 2 total)
  • try something like (from in a specific loop)

    $img_id = get_post_thumbnail_id();
    $img_url = wp_get_attachment_url($img_id);

    That would get you the url of this posts featured image.

    To get all the URL’s of all the images attached to the post…

    $args = array(
    'post_type'   => 'attachment',
    'numberposts' => -1,
    'post_parent' => $post->ID
    );
    
    $attachments = get_posts( $args );
    
    if ( $attachments )
    {
    foreach ( $attachments as $att ) {
    echo wp_get_attachment_url($att->ID);
    }
    }

    That would give you a combined string of the url’s — not very useful but instead you could create a new array of them etc.

    Thread Starter sanquian

    (@sanquian)

    thanks for your answer… i’ll try it and will mark solved if it works

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to get URL http: of an image inserted in post’ is closed to new replies.