Ok, forgive my sloppy code - i'm not a PHP programmer, but i've managed to get by with many of the tutorials and suggestions posted here, but this has me in a bind:
I have the following structure:
Glossary (ID = 74)
Glossary Category (Child Page)
Letter Page (Grandchild Page)
Term (Great-Grandchild Page)
What i want is for the Glossary Category title to appear on any child, grandchild and great-grandchild page of "Glossary", or ID 74. Here's what i have so far:
<?php } else if ( '74' == $post->post_parent || strpos($_SERVER['REQUEST_URI'],'/glossary/')!==false ) { ?>
<?php
$current = $post->ID;
$parent = $post->post_parent;
$grandparent_get = get_post($parent);
$grandparent = $grandparent_get->post_parent;
?>
<h1><?php if ($root_parent = get_the_title($grandparent) !== $root_parent = get_the_title($current)) { echo get_the_title($parent); } else { echo get_the_title($current); }?></h1>
Here's what happens (Page: Title) with the above code:
Glossary: Glossary
Glossary Category: Glossary Category Title
Letter Page: Glossary Category Title
Term: Letter Page Title << i want this to also be Glossary Category Title.
Hopefully i've detailed this enough. Any help is greatly appreciated.