• I use this module as directed in the video and use an upload field. The field shows up but the link is just a number, which is the attachment ID.

    Here is an example:
    <div class="memberdiv"><h3>Will Radford</h3><img src="710" class="mem-pic" />

    The page can be located here: wordpress.christianlife.org/god-stories

    Could you please describe how I get the upload field to instead insert the link to the uploaded image?

    Here is my insert code:

    echo '<img src="' . $member['member-picture'] . '" class="mem-pic" />';}?>

    https://www.ads-software.com/extend/plugins/wck-custom-fields-and-custom-post-types-creator/

Viewing 1 replies (of 1 total)
  • Thread Starter TheDillDesign

    (@thedilldesign)

    And I did try changing it based on the recommendation a few posts down, and thre was no change. Here is my var_dump:

    array(4) { [0]=> string(75) "https://clpress.christianlife.org/wp-content/uploads/2013/07/KyleandSon4.jpg" [1]=> int(200) [2]=> int(195) [3]=> bool(false) }

    Here is my code:

    <?php
    if ( is_home() || is_single() ):?>
    <?php $members = get_post_meta( $post->ID, 'memberinfo', true );
    echo '<div class="memberdiv">';
    foreach( $members as $member){
    echo '<h3>' . $member['member-name'] . '</h3>';
    $image = $member['member-picture'];
    $attachment_image = wp_get_attachment_image_src( $image, 'full' );
    $src = $attachment_image[0];
     var_dump($attachment_image);
    if( !empty( $src ) )
    echo '<img src="' .$member['member-picture']. '"/>';}?>
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Upload field is using attachment ID?’ is closed to new replies.