WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Parent/Child and Navigation Suggestions Needed (5 posts)

  1. evillines
    Member
    Posted 5 years ago #

    I am building a site, through PTA, for our son's school. I'm doing a lot of modifications to a nice template, hard-coding HTML, etc. Basically, I am using WordPress to build and manage a pretty basic "Web site," that will allow other PTA members to easily update site.

    Site is http://www.olympichills.org

    So here is my issue. We are creating a classroom page, that will then have about 30 links to individual "Teacher" pages. They will be responsible for updating their own pages. I want the links for these pages to show up in classroom page, but not everywhere else (e.g., sidebar)

    My plan to is to create a simple table at top of Classroom page, hard-coding links to all the "teacher pages" and then have them open up in new windows. I suppose I could try creating a frame, so it opened below as well.

    The issue here, is every time there i a chance, I will need to hard-code, and trying to create a simple site, that others can update without knowing HTML.

    Any and all suggestions welcome!!!!

  2. MichaelH
    Member
    Posted 5 years ago #

    If you create a Page Template and use the template tag, wp_list_pages(), in that template, then it will automatically reflect any changes you make to your pages.

    Please forget the new window idea--very frustrating!

    Related:
    Pages
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. evillines
    Member
    Posted 5 years ago #

    Thanks....Is there a way to have this reflected in only one page (e.g., the "classroom" page and then only show child pages (individual teacher pages) for this page?

  4. MichaelH
    Member
    Posted 5 years ago #

    In your Page Template you'd use

    <?php
    $teachers = wp_list_pages( 'echo=0&child_of=' . $post->ID . '&title_li=List of Teacher Pages' ) ;
    if ( !empty( $teachers) ) {
      echo $teachers;
    }
    ?>
  5. evillines
    Member
    Posted 5 years ago #

    You Rock. This is exactly what I needed! Thanks so much....

Topic Closed

This topic has been closed to new replies.

About this Topic