Print out all pages
-
Is there a way that I can possibly output all pages in a single template? I would like to output each page, one after the other in their own div, and each page should output something similar to the output at https://www.australianfilmsyndicate.com.au/?page_id=4
I manage this by using a page.php file that has the following code in it:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="postWrapper" id="post-<?php the_ID(); ?>"> <h3 class="postTitle"><?php the_title(); ?></h3> <div class="post"> <?php the_content(__('(more...)')); ?> </div> </div> <?php endwhile; else: ?> <p>Sorry, no pages matched your criteria.</p> <?php endif; ?>
This allows me to output a single page, but I would like to output ALL pages to the main index.php file. Ideally each page would be in it’s own div that contains either an id or class that relates to the page name (not the page id as in the code above).
Note: The reason for doing this can be seen if you view the page at https://www.australianfilmsyndicate.com.au/ – the design works well, but unfortunately from an SEO point of view this is not an ideal solution and I would prefer to do all of the ajax content as inline divs.
- The topic ‘Print out all pages’ is closed to new replies.