2011-10-10, 17:44:39
[/root.] Wrote:Greetings,
What I have
- Parent
--- Child
----- Child
I need to display the content for the 2nd level. For the 1st level child I use the following conditional:
Code:<?php if (get_parent(false)=='parent'){ ?> Content <? }?>
What I should change / add to make the code work for the lower level child pages?
Actually it supposed to be the same conditional but it have to ignore / pass the parent page to reach the main parent page. Please help, my brain is about to blow.
Using the I18n plugin, you can get the top-parent with
Code:
<?php
$bc = return_i18n_breadcrumbs(return_page_slug());
if ($bc[0]['url'] == 'my-parent') {
?>
Content
<?php
}
?>