Currently I'm trying to make a dynamic bootstrap collapse with child page information. The problems I'm facing is how to get the_content(); (it's all text without a read more option) of a child page and how can I make div ID's unique?
<h1>Themas</h1>
<div class="row">
<div id="accordion" class="panel-group">
<?php
$child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?>
<?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a class="accordion-toggle" href="#UNIQUEID" data-toggle="collapse" data-parent="#accordion">
<?php echo $pageChild->post_title; ?>
<i class="indicator glyphicon glyphicon-chevron-down pull-right"></i>
</h4>
</div>
<div id="#UNIQUEID" class="panel-collapse collapse">
<div class="panel-body"><?php echo $pageChild->post_content; ?></div>
</div>
</div>
<?php endforeach; endif;
?>
</div>
Can anyone help me out?
Thanks in advance!