Created
September 7, 2015 16:18
-
-
Save brojask/ef9335e4b5075d085fd6 to your computer and use it in GitHub Desktop.
Single Page for Wordpress Theme
This file contains 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 | |
get_header(); | |
?> | |
<div id="container"> | |
<a name="top"></a> | |
<?php | |
$args = array( | |
'sort_order' => 'ASC', | |
'sort_column' => 'menu_order', //post_title | |
'hierarchical' => 1, | |
'exclude' => '', | |
'child_of' => 0, | |
'parent' => -1, | |
'exclude_tree' => '', | |
'number' => '', | |
'offset' => 0, | |
'post_type' => 'page', | |
'post_status' => 'publish' | |
); | |
$pages = get_pages($args); | |
//start loop | |
foreach ($pages as $page_data) { | |
$content = apply_filters('the_content', $page_data->post_content); | |
$title = $page_data->post_title; | |
$slug = $page_data->post_name; | |
?> | |
<div class='<?php echo "$slug" ?>'><a name='<?php echo "$slug" ?>'></a> | |
<h2><?php echo "$title" ?></h2> | |
<?php echo "$content" ?> | |
</div> | |
<?php | |
} | |
get_footer(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment