GetSimple Support Forum

Full Version: Conditional for the 2nd level child pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
im very bad with php, but can this solve your problem?

<?php get_page_content("name of your page"); ?>

good luck
[/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
  }
?>