• Hi All

    I have searched the archives and read the codex but still don’t understand how to do this problem! I think it might have something to do with being 4.45pm here and my brain has died!

    I have a site: https://www.lostwithiel.org.uk/ which has a large number of pages and these will be growing. What I want to do is to display only the parent page title. Then when I visit that page all links included within that parent page become available.

    Having read through it seems the easiest way to do this, (for me anyway), is to have a template for each category. Then to exclude all pages in the main index.php except for parent ones, then when the user clicks on the right page, this displays all the child pages.

    If I am correct in this, then is there a piece of code please that says, “Display all children” and “only display all parents”, otherwise everytime I or other folks create a new page, I will have to edit the template.

    Or is there a better way to do this?

    Thanks for your help.

    Rich

Viewing 4 replies - 1 through 4 (of 4 total)
  • moshu

    (@moshu)

    Beel

    (@beel)

    Yeah, its in the forum several times (I know as I have posted it a couple of times)…

    <?php if($wp_query->is_page) {

    $lp_param = “”;
    $lp_param = “title_li=<h2>” . __(‘Contents’) . “</h2>&depth=1&sort_column=menu_order&child_of=” .
    $wp_query->get_queried_object_id();
    wp_list_pages($lp_param);
    } ?>

    Thread Starter Richard Brown

    (@cregy)

    Hi Guys

    Thanks so much for the help. I did try the method suggested by Beel but it didn’t work so after using the search suggested by Moshu I ended up using a plugin:
    https://www.webspaceworks.com/resources/cat/wp-plugins/30/
    It worked really well. I am using beta 2 by the way.

    Rich

    Hi Rich,

    Happy that it works for you…

    Just to clarify though, by beta 2 you mean current version of the plugin (v1.0.1) with WP2beta2 I think.

    The companion plugin for categories (fold_category_list) is also working under the WP2beta2… at least as far as preliminary testing reveals.

    Best regards

    Rob

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Menus Parent pages’ is closed to new replies.