WordPress.org

Ready to get started?Download WordPress

Forums

Using Functions on WP Pages (3 posts)

  1. blackc2004
    Member
    Posted 8 years ago #

    I've created a page in WordPress. This page has a lot of Child Pages. I want touse the wp_list_pages(child_of=1787) function to automatically list all the child pages of this page.

    However when I do that it just shows the code. Is there a way to do this?

    Thanks

  2. TechGnome
    Moderator
    Posted 8 years ago #

    2 ways.... one is to get a plugin that will allow you to run PHP from within your posts/pages (search for runPHP plugin).
    The second is to take a copy of your page.php file (give it a new name) and put the code there. Then from in the page management select the page as the template forthe page. In order for it show up, there needs to be a set of comments at the top. IT should looke liek this:
    <?php
    /*
    Template Name: Snarfer
    */
    ?>

    Where "Snarfer" is a name you give it and is what will be selectable from the menu.

    -tg

  3. blackc2004
    Member
    Posted 8 years ago #

    Thanks, I installed runPHP and when I run this function it returns blank.

    You can see it here:
    http://cjbonline.org/index.php/poems/

    Any ideas?

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic