tareq1988 / wedocs

A documentation theme for WordPress
http://docs.wedevs.com
394 stars 129 forks source link

show only grand children instead of with children #40

Closed ufukayyildiz closed 7 years ago

ufukayyildiz commented 7 years ago

hi,

after click a wedocs link, it shows grand children with its children. is it possible to show only grand children,

as on image. wedocs

thank you.

shumbo commented 7 years ago

@atozsoft Hi. That article list is generated by

https://github.com/tareq1988/wedocs/blob/develop/templates/content-single.php#L21

this line. You can provide depth property to limit the depth they query. Probably, what you want to do is to change this line like this.

$children = wp_list_pages("title_li=&order=menu_order&depth=1&child_of=". $post->ID ."&echo=0&post_type=" . $post->post_type);

By adding depth=1, that would displays only the posts directly belongs to the current post.

I hope my understanding of your question is correct and this can help you. Thanks,

ufukayyildiz commented 7 years ago

@shumbo hi,

thank you. this is exactly what i want. fixed my problem. so thanks.