Created
July 15, 2013 11:24
-
-
Save danieldiekmeier/5999262 to your computer and use it in GitHub Desktop.
Wordpress Longpager Snippet
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