i want to make a single page site which has subpages with following structure
about us
team
-member1
-member2
contact
and i want the output to be like
<div class="about-us">
team content
</div>
<div class="team">
team content
<div class="subpages">
<div class="member1">
member1 content
</div>
<div class="member12">
member2 content
</div>
</div>
</div>
<div class="contact">
team content
</div>
and this is my loop so far
<?php query_posts(array('post_type'=>page, 'orderby'=>menu_order, 'post_parent' => $thePostID)); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( 0 == $post->post_parent ) { ?>
<h1><?php the_title(); ?></h1>
<?php } else { ?>
<h3><?php the_title(); ?></h3>
<?php } ?>
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php endwhile; endif; ?>
thanks for helping, helmut
To me it’s very simple, but a bit static.
You can make a new
front-page.php
with the structure you mentioned. Then first make some pages (i.e.: About us, Members 1, Contact etc.) in yourwp-admin
. And use the get_page() function to call different page [using their individual ID] into different zone.Am I right?
Now it is tested. I created PAGE (not POST) in admin panel and then used the page’s ID here in a
front-page.php
file (it will override theindex.php
, but won’t create any problem):I commented inline. The whole thing is tested as per the code given in Codex. I’ve already shared that with you. with
var_dump()
see what it takes for you and improvise it whatever you like. (Thanks to Asadul Islam Sohag for assisting me)Yap! Code is Poetry!