All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: How to print images listed in a custom field?  (Read 873 times)

0 Members and 1 Guest are viewing this topic.

Offline jschodde

  • Newbie
  • *
  • Posts: 21
    • View Profile
How to print images listed in a custom field?
« on: 13 July 2009, 22:16 »
The custom field is called "images" and has data like this:

http://mydomain.com/wp-content/uploads/classipress/2008-thundercat-335620547.jpg,http://mydomain.com/wp-content/uploads/classipress/2008-thundercat-335620548.jpg,http://mydomain.com/wp-content/uploads/classipress/2008-thundercat-335620549.jpg,http://mydomain.com/wp-content/uploads/classipress/2008-thundercat-335620550.jpg,http://mydomain.com/wp-content/uploads/classipress/2008-thundercat-335620551.jpg,

Since the images are not embedded into the actual post, they do not print! How difficult would it be to include them?

I read the post on how to print custom fields which is working, but for images in an array of sorts, is a little more complex. ???

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: How to print images listed in a custom field?
« Reply #1 on: 14 July 2009, 01:15 »
Code: [Select]
$images = get_post_custom_values('images');
$images_array = explode(',', $images);
foreach($images_array as $image) {
if(!empty($image)) {
echo $image;
}
}

Anything more than that, I have to charge for that.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline jschodde

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: How to print images listed in a custom field?
« Reply #2 on: 14 July 2009, 02:38 »
Thanks so much! I got it to work! Now all I need is a way to scale the images. :-\

Offline TIMIT

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 2.8.x
  • Theme Name: Aperture
Re: How to print images listed in a custom field?
« Reply #3 on: 30 December 2009, 12:21 »
Where do I have to put this piece of code?

Thanks for your help!

TIMIT