Template - A-Z of Child Pages - Including 'A', 'B' etc.. (1 post)

  1. bunchofapes
    Posted 2 years ago #

    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 http://www.bee-craft.com/beekeeping-information-centre/ 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 />';

Topic Closed

This topic has been closed to new replies.

About this Topic