WordPress.org

Forums

Submenu classes (3 posts)

  1. devfolio
    Member
    Posted 6 years ago #

    <?php
    								if (is_page( )) {
                      $page = $post->ID;
    
                      if ($post->post_parent) {
                        $page = $post->post_parent;
                      }
    
                      $children=wp_list_pages( 'echo=0&amp;child_of=' . $page . '&amp;title_li=' );
    
                      if ($children) {
                        $output = wp_list_pages ('echo=0&amp;child_of=' . $page . '&amp;title_li=');
                      }
    
                    }
    
                  echo $output;
    
                  ?>

    Thats my current code, works fine. But i have a question, how can i add the class "first" at the first item, and "last" and the last items?

  2. stvwlf
    Member
    Posted 6 years ago #

    this plugin http://www.technokinetics.com/plugins/page-lists-plus/ I believe lets you add a class to the first. Don't know about last.

  3. devfolio
    Member
    Posted 6 years ago #

    Thank you, very useful.

Topic Closed

This topic has been closed to new replies.

About this Topic