How to order content on single page
-
Hi I am using the following code on a page template, it pulls content from other pages that I create and displays the content on a single template to give a one-page theme.
<?php $pages = get_pages(); foreach ($pages as $page_data) { $content = apply_filters('the_content', $page_data->post_content); $title = $page_data->post_title; $slug = $page_data->post_name; echo "<section class='$slug'>"; echo "<div class='row'>"; echo "<div class='small-12 large-12 columns' role='main'>"; echo "<h2>$title</h2>"; echo $content; echo "</div>"; echo "</div>"; echo "</section>"; } ?>
The content is displayed within sections on a single page, but I can’t re-order the content or display it in a certain order. Is there a method I can use to do this?
- The topic ‘How to order content on single page’ is closed to new replies.