Support » Fixing WordPress » php inside php

  • sparrows


    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,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Beel


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



    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php inside php’ is closed to new replies.