• Hi there,

    I need to modify the result of wp_list_pages() function so I can have ids inside the returned

    • .
    • I know I can go to the file classes.php and add the id manually inside the function start_el() but this is not a good technique because I have to modify the core code.

      I’m using gengo plugin and here is my code:
      PHP

      <ul id="menu-pages">
          <?php wp_list_pages('sort_column=menu_order&title_li=' ); ?>
        </ul>

      HTML

      <ul id="menu-pages" class="ui-sortable" style="position: relative;">
        <li class="page_item page-item-4 current_page_item"><a title="Home" href="https://.../home/en/">Home</a></li>
      ...
      </ul>

      And this is what I need:
      HTML

      <ul id="menu-pages" class="ui-sortable" style="position: relative;">
        <li id="page-home" class="page_item page-item-4 current_page_item"><a title="Home" href="https://.../home/en/">Home</a></li>
      ...
      </ul>
  • The topic ‘How to add ids to page list items’ is closed to new replies.