• Resolved millonario

    (@millonario)


    [wpuf-meta name=”meta_key_name” type=”image”]

    Hello, I would like to be able to obtain only the image url as I can do it?

    Thank you so much

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @millonario,

    It’s not possible currently to show the URL using ShortCode( Will add it in future ). You need to customize the single.php template for that. You can add this snippet :

     $attachment_id = get_post_meta( $post->ID, 'meta_key_name', true);
      $url = = wp_get_attachment_url( $attachment_id );
      echo $url; 

    Let me know if it worked for you.

    Thanks

    I thank you very much, but after putting it inside a <?php ?> I do not load the tickets … I think there is a bug in the code …

    How can you log in the URL of this, believe it is valid?

    $images = get_post_meta( $post->ID, ‘meta_keyname’ );

    if ( $images ) {
    foreach ( $images as $attachment_id ) {
    $thumb = wp_get_attachment_image( $attachment_id, ‘thumbnail’ );
    $full_size = wp_get_attachment_url( $attachment_id );

    printf( $full_size, $thumb );
    }
    }

    or do I run the risk of losing URLs with an update?

    Hello @millonario,

    Have you replaced the meta_key with your form field meta_key name? If not then it will not work. Also, we recommend doing any customization inside the theme’s functions.php file so that the changes will not the loss after updating the plugin.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to obtain only the url of the image?’ is closed to new replies.