I was recently working on a client project that required the ability to show a “sub menu” when you’re on a specific page and also the sub-sub page for the first sub page. So for instance I have the following:
1. HOME PAGE
2. HOME PAGE - FIRST PAGE
3. HOME PAGE - FIRST PAGE - SECOND PAGE
Now, I needed to be able to call a list for the FIRST PAGE to showcase any of the SECOND PAGE links, but also pull a list on the SECOND PAGE for anything under that one (ie: THIRD PAGE). I found a quick solution to show sub pages by using a simple piece of php code, but that wouldn’t work for a SUB - SUB PAGE, thus, after some digging and piecing together, this code works like a charm
1. HOME PAGE
2. HOME PAGE - FIRST PAGE
3. HOME PAGE - FIRST PAGE - SECOND PAGE
Now, I needed to be able to call a list for the FIRST PAGE to showcase any of the SECOND PAGE links, but also pull a list on the SECOND PAGE for anything under that one (ie: THIRD PAGE). I found a quick solution to show sub pages by using a simple piece of php code, but that wouldn’t work for a SUB - SUB PAGE, thus, after some digging and piecing together, this code works like a charm










Comments