WordPress.org

Forums

child_of (5 posts)

  1. Mandi
    Member
    Posted 9 years ago #

    I had asked how to make just a category show up in the sidebar and was told to us the child_of ... but I guess I'm doing it wrong, I'm not that good at php.

    The parent page name is Recipes (capital R)

      <?php wp_list_pages('child_of=Recipes'); ?>

    help?

  2. Kafkaesqui

    Posted 9 years ago #

    <?php wp_list_pages('child_of=100'); ?>

    The 'child_of' parameter does not take a Page's title, but the numeric ID for that Page.

    See the Codex page on wp_list_pages() for more on that template tag:

    http://codex.wordpress.org/Template_Tags/wp_list_pages

  3. MichaelH
    Member
    Posted 9 years ago #

    You need to use Page ID for Recipes, not the text Recipes. You can find the ID for that Page in Administration > Manage > Pages panel.

  4. Mandi
    Member
    Posted 9 years ago #

    thank you guys, you're the best..

  5. Mandi
    Member
    Posted 9 years ago #

    man,one more question --how do i make it list only a certain number of pages? like the last four? i tried using depth but it wouldnt word

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags