Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Expandable Page Hierarchy WordPress


Within my top-level of pages, I have a page of information about guitar effects pedals. As sub-pages, I have all of the manufacturers of effects pedals, and as sub-pages of each manufacturer, I have a page for each pedal containing information and links, etc.

So my page structure is roughly

Effects Pedals
- Boss
- - Turbo Distortion
- - Metal Zone
- Ibanez
- - Echo/Delay
- - Tube Screamer

Using the following code on the Effects Pedals page, I am able to output the hierarchy of child pages:

global $post;
$parent_id = get_pages("child_of=".$post->ID."&sort_column=menu_order&depth=1") ? $post->ID : $post->post_parent;
wp_list_pages('title_li=&child_of='.$parent_id.'&depth=3' );

What I'd like to be able to do is use jQuery to collapse the UL of manufacturers and the UL of pedals that manufacturer makes and make them expand on click. So, I need to have a way of disabling the links to the manufacturer pages so that the ULs can be expanded by clicking - or another innovative way of doing this.

Answers (4)


Edouard Duplessis answers:

wp_list_pages() and [[LINK href=""]]jquery treeview[[/LINK]]


Oleg Butuzov answers:

i think yo need [[LINK href=""]]this[[/LINK]]. or [[LINK href=""]]this[[/LINK]], and one more [[LINK href=""]]tutorial[[/LINK]] for the related question


Erez S answers:
Exactly what you are want to do

Erez S comments:

Also try this:

Erez S comments:

Sorry for the triple post,but here is plugin(!) for doing this:


Ehthisham tk answers:

A better tuto with different demo can be found here.

[[LINK href=""]][[/LINK]]