Created
September 27, 2013 04:44
-
-
Save quagliato/6724256 to your computer and use it in GitHub Desktop.
Iterate WP pages and create <section> for them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pages = get_pages( | |
array( | |
'sort_order' => 'ASC', | |
'sort_column' => 'menu_order', | |
'post_type' => 'page', | |
'posts_per_page' => 999 | |
) | |
); | |
foreach($pages as $page){ | |
?> | |
<section id="<?=$page->post_name?>" title="<?=$page->post_title?>"> | |
<div id="left"> | |
<div id="top_img"> | |
<?=get_the_post_thumbnail($page->ID, 'full')?> | |
</div><!--/top_img--> | |
</div><!--/left--> | |
<div id="right"> | |
<?=apply_filters( 'the_content', $page_content );?> | |
</div><!--/right--> | |
</section><!--/section--> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment