WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_pages list parents, uncles, grandparents, but not their children (1 post)

  1. Wows
    Member
    Posted 1 year ago #

    Here's my question, I want to list the pages on my site like the following

    <bro of grandfather with kids not displayed>
    <bro of grandfather with kids not displayed>
    <grandfather>
    	<uncle>
    	<uncle>
    	<father>
    		<brother>
    		<brother>
    		<current page>
    			<my kid>
    			<my kid>
    		<brother>
    		<brother>
    		<brother>
    	<uncle with kids not displayed>
    	<uncle with kids not displayed>
    	<uncle>
    <bro of grandfather>
    <bro of grandfather>
    <bro of grandfather>
    <bro of grandfather>

    So basically we are on the page <current page> and in the list of pages we see only my brothers and my kids, not the the kids of my brothers, not the kids of my kids.

    This also holds true for my father. My fathers brothers (my uncles) are in the list, but not their kids.

    This also holds true for my grandfather... etc...

    so basically recursively from bottom up: List my kids depth=1, list my fathers kids depth=1.

    How do I implement this with wordpress functions? Anyone suggestions? I'm thinking recursively but I don't know if I might be making this too hard for myself by doing so.

    Thanks in advance!

Topic Closed

This topic has been closed to new replies.

About this Topic