Trying to get root ancestor page on level 1
|
35 posts
|
if i have the following tree
i want to know the ancestor page from any subpage. So if i am on “subpage” i want to know that the ancestor (on level 1) is “news” page. here is my code, which seems to work except the recursion does not recur…. any ideas what is wrong? |
|
35 posts
|
Ah forgot to return a value from the recurred function: |
|
1493 posts
|
This is quite nifty, avagraphique! Thanks! Can see uses for this… |
|
1493 posts
|
And just now connecting this up from something similar by Andy (for slug). |