Jump to content

thistimj

Members
  • Posts

    71
  • Joined

  • Last visited

Community Answers

  1. thistimj's post in How do I get image from children was marked as the answer   
    I'm not sure you need the $k => $p where you have it. It should work with this:
    <?php foreach($page->children as $child): ?> <div class="mask"> <img src="<?php echo $child->images->first()->url; ?>" /> <h2><?php echo $child->headline; ?></h2> <?php echo $child->body; ?> <a href="<?php echo $child->url; ?>" class="info"><?php echo $child->title; ?></a> </div> <?php endforeach; ?> If I'm understanding you correctly, this should get you most of the way to where you want to go. I'm not a php expert and I haven't tested this, but I think that's right. Let us know if that works.
×
×
  • Create New...