• Resolved ArielZusya

    (@arielzusya)


    I’m working on a site for a small law firm. I’ll preface this by saying that I’m a novice when it comes to coding and such but I’m taking a stab at creating a custom site for the firm. I’ve managed to do everything I’ve wanted to do with the site except for one thing and it is that one thing about which I am now writing.

    I have a page on the site where I’d like to list the attorneys in the firm. To make the content on the site easily updated in the future, I’ve separated out the attorneys into groups (Partners, Associates, Special Counsel and Of Counsel). This ultimately means that there is an “attorneys” page which has four children (those four groups listed above). I then have pages for each of the attorneys in each group as children of those groups.

    What I’d like to do is list all the children of one group in one list, then all the children of the next group in the next list, and so on. I got as far as using the code found on this topic to generate a list of children of the current page but I’m not sure how to limit the list to only the grandchildren of a particular child of the page. So you don’t have to jump back and forth, the code is as follows:


    <p style="text-align: center;"><?php the_title(); ?></p>
    <?php $pages = get_pages('child_of='.$post->ID.'&sort_column=menu_order&sort_order=asc&parent='.$post->ID); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; if($count >= 2) break; $count++; ?>
    <?php echo $page->post_content ?>
    <?php } ?>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    </div>
    </div>

    Any assistance would be greatly appreciated! Thanks in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Clickable list of certain pages’ is closed to new replies.