Support » Themes and Templates » Template – A-Z of Child Pages – Including 'A', 'B' etc..

  • Hello all

    I am trying to figure this out, I can get in a list of child pages via php but I need to display what letter they are under and be able to pop a div around it to style the letter..

    See for the kind of thing I am working on..

    Any help appreciated! BTW the code im using isnt woking alphabetically, so if thats easier to sort, here it is:

    <div id="content" role="main">
            $my_wp_query = new WP_Query();
            $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));
            $children = get_page_children($post->ID, $all_wp_pages);
            foreach ($children as $child)
                if($letter != $first_letter)
                $col = 3; //how many columns
                for($i = 0; $i < $col; $i++) {
                        $nr = (int)(sizeof($alphabetic)/4);
                        $i == $col - 1 ? $end = sizeof($alphabetic) : $end = $nr*($i+1);
                        for($j = $nr*$i; $j < $end; $j++) {
                                echo '<div class="BIClettertitle"><b>', $alphabetic[$j]->post_title, '</b></div><br />';
                                echo '<div class="BICletterlink"><a href="'.get_permalink($alphabetic[$j]->ID).'">'.$alphabetic[$j]->post_title.'</a></div><br />';
  • The topic ‘Template – A-Z of Child Pages – Including 'A', 'B' etc..’ is closed to new replies.