Jump to content

Repeat from child pages displays last child page?


deadbeat
 Share

Recommended Posts

Hello I am new on here...

I am trying to create a page that has four columns and several rows.  each column at the moment should show a different city from a child page but it is only showing the last city in each well, the code works to the point of the last city but does not show the first city.  I have included the code below which I have "borrowed" from 

<div class="container">
<?php foreach($page->children as $c); ?>
<div class="row">
<div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                                <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                        <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                                <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>

</div>

                        
<div class="row">
                        <?php foreach($page->children as $c); ?>
<div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                                <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                        <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>
                                <div class="col-xs-6 col-md-3">
<div class="well"><h2><?php echo $c->title; ?></h2>
<p><?php echo $c->summary; ?></p></div>
</div>

</div>
              
</div> 

What am I missing ?

Thanks

Link to comment
Share on other sites

the code  you are providing doesn't make any sense; did you mean to do something like this?

<div class="container">
	<div class="row">
		
		<?php foreach($page->children as $c) { ?>

		<div class="col-xs-6 col-md-3">
			<div class="well">
				<h2><?php echo $c->title; ?></h2>
				<p><?php echo $c->summary; ?></p>
			</div>
		</div>

        <?php } ?>

	</div>           
</div> 
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...