deadbeat Posted August 2, 2015 Share Posted August 2, 2015 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 More sharing options...
Macrura Posted August 2, 2015 Share Posted August 2, 2015 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 More sharing options...
deadbeat Posted August 4, 2015 Author Share Posted August 4, 2015 Thanks that sorted it out. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now