WordPress.org

Support

Support » Plugins and Hacks » [Resolved] get_attachment_url

[Resolved] get_attachment_url

  • hi
    I’m using “WP User Frontend” for my ebook-library website.
    when I attached the pdf, the plugin automatically generate like the below codes

    <ul class="wpuf-attachments"><li><a href="localhost/wp-content/uploads/2013/01/mypdf.pdf" title="mypdf">mypdf</a></li></ul>

    here I just only want the attachment URL , so how can I call it in the loop
    as I’m beginner, I don’t know how the plugin codes work at the background process.
    if someone could help me thanks

    http://wordpress.org/extend/plugins/wp-user-frontend/

Viewing 2 replies - 1 through 2 (of 2 total)
  • actually I want to embed like this
    <embed src=”http://localhost/wp-content/uploads/2013/01/mypdf.pdf” width=”100%” height=”700″>

    even I do like this, nothing has come up
    <?php wp_get_attachment_url($attachment->ID, ‘wpuf_file’, true ); ?>
    may be I don’t know to attachment slug name

    waiting for the answer

    uhh , fixed it by myself 😀

    <?php
    $args = array(
        'post_type' => 'attachment',
        'numberposts' => null,
        'post_status' => null,
        'post_parent' => $post->ID
    );
    $attachments = get_posts($args);
    if ($attachments) {
        foreach ($attachments as $attachment) {
            echo wp_get_attachment_url($attachment->ID, '');
        }
    }
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] get_attachment_url’ is closed to new replies.