WordPress.org

Ready to get started?Download WordPress

Forums

how to arrange pages/categories (4 posts)

  1. kekskerl
    Member
    Posted 7 years ago #

    hej there, maybe silly question, but is there a possibility to have subpages arranged in different categories or according pages, but in seperate "boxes"? to see what i mean, go to http://www.unet.univie.ac.at/~a0407488/php/ . there are the "boxes" news, turniere, etc, i'd like to have pages in those categories, but don't know how to arrange this. couldn't find anything in the docs, tried it with wp_listpages, but honestly, i just didn't see anything of help for me. thanks a lot in advance!

  2. Bodhipaksa
    Member
    Posted 7 years ago #

    You can use the child_of=x parameter (where x is the post number of the page in question) to show a list of pages in one "category." Pages don't have categories, of course, but by using the parent-child relationship you can mimic categories.

  3. kekskerl
    Member
    Posted 7 years ago #

    sounds good, that's what i thought about, but i don't know how to do it exactly.

    say, could you write me, how to do this:

    parent= bla1
    child: blablabla1

    parent= bla2
    child: blablabla2

    what command in what structure do i need to put into the sidebar?

    thanks a lot mate!

  4. Bodhipaksa
    Member
    Posted 7 years ago #

    It's all at http://codex.wordpress.org/Template_Tags/wp_list_pages, but here's what you do.

    First, you need to have pages in a parent-child relationship, which you do when creating or editing a page. That's just done on the drop-down list.

    Then in your sidebar (or wherever) you'd have code that looks like this:

    <ul>
    <?php
    wp_list_pages('child_of=10'); ?>
    </ul>

    (This assumes that you want to list the child pages of the page that is post number 10).

    You can add other arguments as well as child_of, for example:

    <ul>
    <?php
    wp_list_pages('sort_column=menu_order&child_of=10&depth=3&title_li='); ?>
    </ul>

    It all depends on what you want to do.

Topic Closed

This topic has been closed to new replies.

About this Topic