Support » Fixing WordPress » where is the code to display page list?

  • I’m trying to make a dynamic menu so I need to edit some of the code, but I don’t know where to locate it.

    I’m looking for this code:

      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <?php echo $children; ?>
      <?php } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • If that code exists at all, it will be inside of the theme files for the theme you’re currently using. However, not all themes necessarily have that code, so you might not find it. Those that do will all have that code in different places (and it might not look exactly like that).

    Where on your site does the list of pages actually appear? If it’s across the top of the screen, then you’d probably find the code in the header.php file (though not definite); if it appears on the side of the screen, it could be in sidebar.php or index.php. It might even be in multiple files, depending on how the theme is set up.

    Good luck.

    First off, thanks for your response.

    Second, the code is in the sidebar, but its pulled in from a widget so I believe that its defined in the header.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘where is the code to display page list?’ is closed to new replies.