WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_pages - Active state (2 posts)

  1. dipankarbanerjee
    Member
    Posted 7 months ago #

    Hi,

    I have a list of child page generated with...

    <?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) { ?>

      <?php echo $children; ?>

    <?php } ?>


    Can anyone suggest how to assign a Active state to these links,
    example: like active state of menu items.

    Warm Regards

    Dipankar

  2. alchymyth
    The Sweeper & Moderator
    Posted 7 months ago #

    the function automatically generates .current-... classes;

    http://codex.wordpress.org/Function_Reference/wp_list_pages#Menu_Item_CSS_Classes

Reply

You must log in to post.

About this Topic