php inside php (3 posts)

  1. sparrows
    Posted 10 years ago #

    Hi all :)

    Is it possible to use a php command inside another?
    I'd like to have a list of the child Pages on the Parent Page, and I tried all of these (and some more combinations) on the Page template:

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

    No list of pages shows up at all. When I manually enter the page ID for a Page, it does work though.

    Does PHP not allow this kind of nesting? If not, is there another way to get the page ID in the tag?

    Many thanx,

  2. Beel
    Posted 10 years ago #

    No you can't, shouldn't and wouldn't - what is it you are trying to acomplish?

  3. moshu
    Posted 10 years ago #

    I am not a PHP guru but PHP doesn't work with that kind of "nested" tags. That's for sure, the issue came up several times in the forum.
    There might be a solution given somewhere in the jungle of the forum, so you may want to try searching.

Topic Closed

This topic has been closed to new replies.

About this Topic