• Hello,

    I have a page with a number of subpages

    Page
    – Subpage 1
    – Subpage 2

    – Subpage N

    Is there a way to automatically show all subpages (1-N) when someone clicks on “Page”?

    I have browsed a lot but could not find a plugin that does that (I found a lot that list the titles but none of them actually “inserts” the content).

    Thanks
    mercator

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have a look at the Fold Pages plugin/widget:

    https://www.mealldubh.org/index.php/software/fold_page_menus_widget/

    Thread Starter mercator

    (@mercator)

    Thanks. That’s not quite what I wanted: I need a plugin that EXPANDS (=INSERTS) the actual content of the subpages in the parent pages. The idea is is as follows: I have a topic in a static page with a number of subtopics. When the user clicks on the page, I want him/her to see all the subpages wo he/she can read all the info in one go without having to click on any more links…

    Ah! I used the following code inside the Loop within a customised template to achieve a similar effect:

    <?php
    $my_slug = get_permalink();
    $args = array(
    	'numberposts' => -1,
    	'post_parent' => $post->ID,
    	'post_type' => 'page',
    	'post_status' => 'publish',
    	'orderby' => 'menu_order,title',
    	'order' => 'ASC'
    );
    $my_pagelist = &amp;get_children($args);
    if ($my_pagelist) :
    foreach($my_pagelist as $my_child) :
    $my_child_slug = $my_slug.$my_child->post_name.'/';
    ?>
    <div class="sub_page">
    <h3><?php echo $my_child->post_title;?></h3>
    <?php echo $my_child->post_content; ?>
    </div>
    <?php endforeach; ?>
    <?php endif; ?>

    I then assigned the new template to the parent Page(s) as required. Just remember to changed the encoded ampersands above into a plain &.

    Hope that helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Expand all subpages – is that possible?’ is closed to new replies.