- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi Guys
I am using the Advanced Custom Fields plugin with the Repeater Field add-on to display a product image, description and price.
This works fine on most fields, however, when the field type is an image, it just displays the word ‘array’ on the website.
Here is my code to call the plugin….
if($rows) {
foreach($rows as $row)
{
echo $row, $row, $row;
}
}
?>
and here is what it outputs… http://noteha.co.uk/dev/products/ – The word ‘Array’ is where the image should go.
These are my admin settings https://dl.dropbox.com/u/94593656/Screen%20Shot%202012-12-16%20at%2014.24.05.png and the image does display on the page admin.
I can’t think what this could be.
Any help would be great.
Ok figured it out, I had to actually state the img src in my code.
For any one else that wants to know, the correct code should be this..
if($rows) {
foreach($rows as $row)
{
echo ‘‘, $row, $row;
}
}
?>
I was about to say you have to wrap it in `` but you already figured it out.
I had the same problem the other week and couldn’t figure it out.
yeh it’s a shame they don’t include this on the documentation (unless I missed it) but it truly is a great plug-in and add-on.
> yeh it’s a shame they don’t include this on the documentation (unless I missed it) but it truly is a great plug-in and add-on.
This is a standard method of using images within WordPress, pre-wrapping an image with an HTML `` can cause issues because there are instances where we may only want the URL to the image and nothing else.
While it may not be specified in the plugin docs I have seen somewhere in the WordPress docs that it does only return paths.