Siblings of post and siblings of parent together

Question

nice day there.

I need to return the siblings of post and siblings of parent page in the same list with wp_list_pages().

E.g. We have the following tree.

LEVEL 1

-LEVEL 2 A

–3a1

–3a2

–3a3

-LEVEL 2 B

–3b1

–3b2

-LEVEL 2 C

-LEVEL 2D

–3d1

If it’s a page at level 2a it should display:
-LEVEL 2 A
–3a1
–3a2
–3a3
-LEVEL 2 B
-LEVEL 2 C
-LEVEL 2 D

Pages 3b1, 3b2, 3d1 should NOT be listed.

If it’s a page at level 3a1 I’m going to use ancestor and display the same, that’s ok.
How do I get all these page at one list?

0
Nemo_N 2 months 0 Answers 16 views 0

Leave an answer