WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] list_pages Question (3 posts)

  1. XSK8
    Member
    Posted 4 years ago #

    Hi everybody, I'm using wp function list_pages to show an additional navigation for a specific page and its children.
    I'm using the code as follows:

    <?php
      if($post->post_parent)
      $children = "wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      else
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      if ($children) { ?>
      <ul>
      <?php echo $children; ?>
      </ul>
        <?php } ?>

    Does anyone knows how to get an ID or Class to the link results of the statement to indicate the current page via css?

    Any hint would be appreciated!!! THX !!!

  2. XSK8
    Member
    Posted 4 years ago #

    no idea?

  3. XSK8
    Member
    Posted 4 years ago #

    sorry i found out: this class is set by default... I'm blind... :(

    When wp_list_pages() is called while displaying a Page, the list item for that Page is given the additional class current_page_item.

Topic Closed

This topic has been closed to new replies.

About this Topic