Multiple “sections” on one site
-
Hey,
Trying to make multiple, editable sections on one page. Dunno if it’s possible and wordpress theme development is a new thing for me.I tried to create pages with a parent page and got this:
<?php $post = get_post(); $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date'); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; if($count >= 5) break; $count++; $content = apply_filters('the_content', $content); $pageID = $page->ID ?> <section> <?php if ( has_post_thumbnail($page->ID) ) { ?> <?php echo get_the_post_thumbnail($pageID, 'full', array( 'class' => 'featured-image' ));?> <!--<div class=featured-image style="background: url(<?php /* echo get_the_post_thumbnail_url($page->ID, 'half') */?>) no-repeat center center fixed;"></div> --> <div id=section-text><?php echo $content ?></div> <?php } else {?> <div id=section-text><?php echo $content ?></div> <?php } ?> </section> <?php } ?>
It works fine, except I cant change the layout of the page. Is there a easier way to do this? If not? is it possible to get sub-pages from parent-page and display them with the template on the page?
/Fredric
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Multiple “sections” on one site’ is closed to new replies.