That piece of code is specifically to display child elements of a certain page. The first line could be called the selector, as you can see it is only grabbing pages which have the parent set to $a.
If you are just feeding the current page slug into $a it will not work on a subpage, this is because there are no pages that have the subpage as parent. If you want to use this code snippet you’ll want to make some sort of check like:
If you are just feeding the current page slug into $a it will not work on a subpage, this is because there are no pages that have the subpage as parent. If you want to use this code snippet you’ll want to make some sort of check like:
- If this page has no parent, put this page’s slug in $a.
- If this page has a parent, put this page’s parent’s slug in $a.
“Don’t forget the important ˚ (not °) on the a,†says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!