Jump to content

Child URL Help


jmn817
 Share

Recommended Posts

Hi,

I'm having some issues with one of my foreach loops that are not linking correctly. The goal is on a parent page to show the recent articles (the children) in a grid that displays the image, title, and link to the respective article. Almost everything works, I'm able to display the child's image and title fields, but the only thing that is not working is the url. It always links back to the parent page (or the page where the grid is).

<?php foreach ($page->children('limit=10') as $child): ?>
               <div class="gridcontainer"><br><img class="gridimages" src="<?php echo $child->article_image->url; ?>" /><br>
                   <br><div class="gridtitles"><a href="<?php $child->url; ?>" > <?php echo $child->title; ?> </a></div><br>
                   </div>
            <?php endforeach; ?>

My code is above, and I'm just not sure what I'm doing wrong with this approach. 

Thank you for your time.

Jesse

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...