Forum

Thread tagged as: Question

Only display subpages and primary page

Hi,

I have a page called About and there are pages located below it. On the About page I want a sidebar that displays links to the about subpages only-- nothing else. Then, on each subpage, I want a sidebar that displays the same thing but with a link to the parent about page, too.

Here's the code I am using:

                        <?php
                            perch_pages_navigation(array(
                                'include-parent' => false,
                                'only-expand-selected' => true,
                            ));
                        ?>

It is not working, though. See here: https://pacasatesting.site/about-pa-casa/

Thank you, Trevor Brandt

Trevor Brandt

Trevor Brandt 0 points

  • 5 years ago
Simon Clay

Simon Clay 127 points

Hi Trevor,

Does this work any better?

<?php 
    perch_pages_navigation(array(
        'from-path'            => '*',
        'include-parent'       => false,
        'siblings'             => true,
    ));
?>

Sorry for the late response.

Thanks for the code! That works perfectly on subpages, but not the top level primary pages.

Examples:

https://pacasatesting.site/about-pa-casa/administration-staff-and-board-members.php (works perfect as it shows a link to the parent page and any other pages on the same level as it).

https://pacasatesting.site/about-pa-casa/ (not so great because it shows all pages on the same level, including links to all other pages on the website).

I've found a fix.

Thank you.

Simon Clay

Simon Clay 127 points

Great :)