GetSimple Support Forum
Conditional for the 2nd level child pages - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Conditional for the 2nd level child pages (/showthread.php?tid=2270)



Conditional for the 2nd level child pages - [/root.] - 2011-10-09

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.


Conditional for the 2nd level child pages - sausage - 2011-10-10

im very bad with php, but can this solve your problem?

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

good luck


Conditional for the 2nd level child pages - mvlcek - 2011-10-10

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