The MU forums have moved to WordPress.org

Ditch the dupe in wp_list_pages (2 posts)

  1. drmike
    Member
    Posted 17 years ago #

    One of the common pet peeves over in wp.com land is how if you have a static front page, the page that you use gets listed twice in wp_list_pages if the theme uses a static home link like most of them do.

    Here's a work around:

    <?php
    $tmpexclude =  get_option('page_on_front');
    $tmpline = 'sort_column=menu_order&depth=1&title_li=&exclude=' . $tmpexclude;
    wp_list_pages($tmpline);
    ?>

    Gotta admit that you have to do this in each theme while adjusting the content of the $tmpline.

    Anyone care to tackle this in core code?

  2. mrjcleaver
    Member
    Posted 17 years ago #

    Would this be written as a filter on wp_list_pages?

About this Topic

  • Started 17 years ago by drmike
  • Latest reply from mrjcleaver