View Single Post
Old 04-22-2016, 09:05 AM  
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,382
Quote:
Originally Posted by JosephFM View Post
Now, how do I extract those images?
That's easy. Just add this to the "Custom Field":

Code:
url->url
and all images will be placed into the $post['custom_fields']['url'] array. You can access them in your PHP code like this:

Code:
$post['post_content'] = '<img src="' . $post['custom_fields']['url'][0] . '" />';
or like this to display a random image:

Code:
$post['post_content'] = '<img src="' . $post['custom_fields']['url'][rand(0, count($post['custom_fields']['url']) - 1)] . '" />';
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote