Forum Replies Created

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • in reply to: Security #3026
    dawood
    Member

    ok I got it figured out, I had the post meta, calling in the wrong id.. thanks Steve.

    in reply to: Security #3025
    dawood
    Member

    thanks Steve, I tried it earlier but not dice. might be that I am getting variables mixed up?

    `<?php
    $image_ids = get_post_meta($post_id=’forms’, ‘my_image’);
    foreach ($image_ids as $image)
    {

    $myupload = get_post($image);
    $title = $myupload->post_title;
    $description = $myupload->post_content;
    $caption = $myupload->post_excerpt;

    echo ‘title:’ . $title;
    echo ‘description:’ . $description;
    echo ‘caption:’ . $caption;

    echo ‘‘;

    print_r($myupload); // Displays all data
    }
    ?>

    in reply to: Security #3023
    dawood
    Member

    Thanks Steve, am testing it right now and trying out all the fields! Though am stuck already.. 🙂

    So I registered a field

    // Upload Image / File
      piklist('field', array(
      'type' => 'file'
      ,'field' => 'my_image'
      ,'label' => 'Upload image'
    ));
    
    and am trying to call it to my single.php but for some reason i can't seem to get it
    
    <?php 
    	foreach ($image_ids as $image)
    	{
    		$image_ids = get_post_meta($post_id, 'my_image');
    		$myupload = get_post($image); 
    		$title = $myupload->post_title;
    		$description = $myupload->post_content;
    		$caption = $myupload->post_excerpt;
    
    		echo 'title:' . $title;
    		echo 'description:' . $description;
    		echo 'caption:' . $caption;
    
    		echo '<img src="' . wp_get_attachment_url($image) . '" />';
    
    		print_r($myupload); // Displays all data
    	}
     ?>
Viewing 3 posts - 16 through 18 (of 18 total)