Support » Themes and Templates » Display a specific page and its sub pages on main page

  • Resolved Steve


    I’m trying to display specific wordpress pages and their sub pages on a section of my main page.

    At the moment my structure is:
    Main Page
    Service Page
    -Service Type 1
    –Service Type 1, Item 1
    –Service Type 1, Item 2
    -Service Type 2
    –Service Type 2, Item 1
    –Service Type 2, Item 2

    I know how to list my “services types” on my “services page”, but I’m having trouble trying to display the pages and then there sub pages from my main page template.

    I would like to display the title of my “services type” pages and then list the sub services underneath. Something similar to

    In the upper grid images in the above link, I would like to have my services title and then a list of the services I offer.

    I’m pretty sure I have to enter a specific page ID but I’m unsure were to begin.

    Any help would be great.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I found a way of getting a basic list of the pages and their sub-pages by using:

    <?php wp_list_pages('include=453&title_li='); ?>
    <?php wp_list_pages('child_of=453&sort_column=post_title&title_li=') ?>
    <?php wp_list_pages('include=457&title_li='); ?>
    <?php wp_list_pages('child_of=457&sort_column=post_title&title_li=') ?>

    My skills in php are basic at best, can anyone help with the above?
    It doesn’t seem to be the correct way of doing what I’m looking for.

    I would like to use css to edit the titles and the children above and rather than repeat code can I use a loop to do this??

    So after a few hours of searching I haven’t been able to find what I’m looking for.

    I’m trying to make an array of page ids and display the titles of these pages.

    Then I want to search the array and see if the pages in it have children and if so display the child titles underneath as links (following my css).

    It doesn’t sound to difficult but I can’t seem to get my head around it. I have been mashing code together but cant figure it out.

    Anyone got any suggestions?

    Turns out instead of listing pages and sub pages it was easier to create a new menu in order to achieve what I was trying to get.

    I used the code here to make the second menu:

    I had a problem with the ‘home’ page appearing in the second menu so I used the function found here to remove it:

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display a specific page and its sub pages on main page’ is closed to new replies.