• I have this code in my sidebar:

    <?php
    $output = wp_list_pages('echo=0&depth=1&title_li=<h2>Main Menu </h2>&exclude=73' );
    if (is_page( )) {
      $page = $post->ID;
      if ($post->post_parent) {
        $page = $post->post_parent;
      }
      $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' );
      if ($children) {
        $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=<h2>' . __('Menu') . '</h2>');
      }
    }
    echo $output;
    ?>

    The last . $page . returns the id number id of the page where I need it to return the title of the page. What do I do? Any help will be greatly appreciated. Thanks.

Viewing 1 replies (of 1 total)
  • In PHP.
    get_the_title( $page );

    As a variable.
    $somevariable = get_the_title( $page );

    You’re not really being very clear of what you’re trying to do in correlation with what you have above.

Viewing 1 replies (of 1 total)
  • The topic ‘How to turn . $page . into a variable’ is closed to new replies.