WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] List Pages add style if item is current page

[Resolved] List Pages add style if item is current page

  • Hey Gang,

    I’m trying to pull a list of pages under a parent page (these are pages not posts) and in that list, I need to check to see if the page is the current one, and if so, add a class=”current” line to the List Item

    So I imagine if the parent page ID was 38 we’d start like this:

    <?php
      wp_list_pages( 'title_li=&child_of='.'38' );
    ?>

    but I’m clueless as to how to add the class if the page id is the page we’re on. I’m sure this isn’t as complicated as I’m trying to make it, but I’m a designer, not a php guy.

    Any help is GREATLY appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] List Pages add style if item is current page’ is closed to new replies.