wp_functions and adding image post
Author | Posts |
---|---|
February 20, 2014 at 2:47 am 15675 | |
Tareq Hasan | hi there, i added a bunch of functions in the wpuf_functions.php file so that your forms work on my site. i am currently using an image upload on one of my forms and don't know how to display the image on my items page. i added the following code, but i know this is wrong. can you help? 'first_photo' => isset( $_POST['first_photo'] ) ? $_POST['first_photo'] : '', |
February 20, 2014 at 2:49 am 15676 | |
amelaunsworth | and this is the code on the items page: if (!empty($options['first_photo'])) img src="{timthumb src => $post->first_photo, w => 120, h => 160}" alt="{__ 'Item image'}" |
February 20, 2014 at 2:55 am 15681 | |
Tareq Hasan | Have you checked out this? http://docs.wedevs.com/showing-meta-fields-in-frontend/ |
February 20, 2014 at 3:12 am 15682 | |
amelaunsworth | thanks for the link. i posted: $images = get_post_meta( $post->ID, ‘mey_key_name’ ) if i post the entire code that is on that page, i get an error and my page doesn’t show up at all. and i’m not sure if it’s working. when i check my admin, i see my image posted under the custom fields area, but not under the main item area. maybe because i added the wrong code in the wpuf_fuctions.php page? under the main item area i don’t see an image, but i see thte text ‘first_photo’ (all my fields are duplicated in the admin because of the custom field types). i don’t know how to show the image instead of the text first_photo. ‘first_photo’ => isset( $_POST[‘first_photo’] ) ? $_POST[‘first_photo’] : ”, |
February 20, 2014 at 3:23 am 15683 | |
amelaunsworth | check out my profile page. http://www.godurhamregion.com/item/test-company-3/ the code from the documentation page shows up and no image. |
February 20, 2014 at 5:29 am 15686 | |
amelaunsworth | i had to remove the code from the documentation because my site is live. |
February 20, 2014 at 9:31 pm 15698 | |
amelaunsworth | hi taraq, |
February 21, 2014 at 1:26 am 15702 | |
Tareq Hasan | May be you had some wrong characters in your code. Try this one http://pastie.org/8752996 |