I'm trying to create an one page template [ w/out infinite scroll ]. The two problems I'm running into are adding a class to the list pages function [ or finding some other way to target the menu for smooth page scrolling ] && dynamically loading each page inside of a section or div all on one page.

Any thoughts?

  • So you want a twitter-esque page where as you scroll down it loads more posts? Commented Feb 14, 2012 at 18:13

1 Answer 1


I understand now!

You just need to figure a way to programmatically generate sections of code with anchors and have your main menu link to those anchors!

    $args = array(
        'post_type' => array( 'page' ),
        'post_status' => array( 'publish' ),
        'orderby' => 'menu_order',
        'order' => 'asc'
    query_posts( $args );

    if (have_posts()) : while (have_posts()) : the_post();
        <section id="<?php the_permalink(); ?>">
            <?php the_content(__('(more...)')); ?>
<?php endwhile; else: ?>
    <p>Sorry, no pages matched your criteria.</p>
<?php endif; ?>

For the menu you can do this:




We need to figure out how to get the permalink or ID for the pages from wp_list_page... we need a walker!


I would recommend posting a new question at this point.

"How do I write a Walker for wp_list_pages for permalink URLs."

You're basically trying to replace the WordPress generated URLs with anchor tags.

  • I've used Infinite Scroll before // The only problem is that I want to load multiple pages, not multiple posts // I was originally thinking of having the blog page load last && then using Infinite Scroll to continue to load pages // I was able to hard code each page in, but I need it to be dynamic for clients.
    – flash
    Commented Feb 14, 2012 at 18:38
  • Sounds like some usability design comes into play here. Logically how does a user scroll through pages and then transition into scrolling posts? I think the concept works fine with one or the other, but both could cause some issues. If you were going to exclude posts and just do pages, You could modify infinite scroll to do that pretty easily. In WordPress everything is a post. Just different meta information. Commented Feb 14, 2012 at 18:40
  • Any ideas on using Infinite Scroll to grab pages && display them in order ?
    – flash
    Commented Feb 14, 2012 at 18:46
  • Updated the answer. Commented Feb 14, 2012 at 19:02
  • 1
    @kaiser // did that (:
    – flash
    Commented Feb 14, 2012 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.