One page theme: pages margin and page order (How to?) (2 posts)

  1. shablon
    Posted 2 years ago #

    i'm working on a one page theme. Here is the code i use to get all of the pages to display on one page

    `<?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 "<div class='$slug'>";
    echo "<h2>$title</h2>";
    echo $content;
    echo "</div>";
    No problem there

    Two questions I have are

    1)How do i get to display pages in certain order? I tried setting up order in admin panel, but it didn't work at all

    2)How do i set up margins between these pages?

    Thank you!

  2. John Parris
    Posted 2 years ago #

    get_pages takes arguments for sorting. Check out sort_order and sort_column.

    To get margins, just add an extra class to the wrapping div and add the appropriate CSS.

Topic Closed

This topic has been closed to new replies.

About this Topic