heres what that line of code looks like if it helps.
Hi
Yes " />
is where my image code is supposed to be, I couldn’t get it to show up.
I have my image set to image id the way that elliot has it in this video:
I tried changing it to image url but it made no difference.
i really don’t know where I have gone wrong…
sorry I copied the wrong code, that code above didn’t mention image anywhere…
<?php if(get_field('vessels')):?>
<div class="vessel">
<?php while(has_sub_field('vessels')): ?>
<img />" />
<?php the_sub_field('name'); ?>
<?php the_sub_field('type'); ?>
<?php the_sub_field('year'); ?>
<?php the_sub_field('lxb'); ?>
<?php the_sub_field('pull'); ?>
<?php the_sub_field('passengers'); ?>
<?php the_sub_field('spec'); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
i can't get the image line to display its above the sub field called name:
<img src="<code><?php $image = get_sub_field('image'); echo $image['url']; ?></code>" />
only ignore the <code></code>
Hi rywn
I have a similar sort of issue to musiconvinyl above. Hoping you can help me?
I want to have my data outputted in a sort of table. Like this website:
http://www.clyde-marine.net/index.php?id=19
So because I am quite new to custom fields and the repeater plugin I started by watching Elliot Condons video on Vimeo. I copied his code only I used my own names etc. Like this:
<?php if(get_field(‘vessels’)):?>
<div class=”vessel”>
<?php while(has_sub_field(‘vessels’)): ?>
” />
<?php the_sub_field(‘name’); ?>
<?php the_sub_field(‘type’); ?>
<?php the_sub_field(‘year’); ?>
<?php the_sub_field(‘lxb’); ?>
<?php the_sub_field(‘pull’); ?>
<?php the_sub_field(‘passengers’); ?>
<?php the_sub_field(‘spec’); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
the outcome at the minute looks like this: http://www.heathermcfadden.co.uk/johnmtest/our-fleet-and-equipment/
I can’t figure out why the image isn’t showing. When my code to me doesn’t look any different than Elliots. Any ideas?
I just wanted to get all my fields showing first then I was going to use div’s to lay them out. Not sure if this is the best way to create a table sort of look. So if you think I’m going about it wrong any suggestions would be much appreciated.
Thanks
Heather
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.