After some playing, the latest I have is
[array]
[field image=gazettepics in=url]
[/array]
This returns only one result however. When I added the debug=true parameter however, I can see the full array for that custom field, as follows:
[gazettepics] => Array
(
[0] => img_url_1.jpg
[1] => img_url_2.jpg
[2] => img_url_3.jpg
[3] => img_url_4.jpg
[4] => img_url_4.jpg
)
If I were hardcoding this into the template in PHP, it’s simple:
<?php
$gazpics = get_post_meta($post->ID, 'gazettepics', false);
if( count( $gazpics ) != 0 ) {
foreach($gazpics as $gazpics) {
echo '<a class="gazpiclink" href="'.$gazpics.'"><img class="gazpicthumb" src='.$gazpics.'></a>';
}
} else {
}
?>
But I need to be able to achieve the same thing using the shortcodes from this plugin.
Any help would be greatly appreciated!!!
So now I am managing to output the array with simply:
[loop type=gazette taxonomy=gaztype term=deptintro relation=and taxonomy_2=gazissue term_2=issue-1 relation=and taxonomy_3=gazdept term_3=epd]
[content]
[array]
[field gazettepics]
[/array]
[/loop]
This outputs the array as a comma separated string, like so:
https://example.com/IMG001.jpg, https://example.com/IMG002.jpg, https://example.com/IMG003.jpg, https://example.com/IMG004.jpg
I’m not sure how I can turn these into images. If I adjust the [field] as follows,
[array]
[field image=gazettepics in=url]
[/array]
it works but only retrieves the first image in the array.
Couldn’t work this out, so used
[array]
<div class=”pics”>[field gazettepics]</div>
[/array]
And split the string and wrapped them in an image tag with JS/JQuery. Works well enough.