cptnem0
asked on
Show parent title when in child and when in parent
Im trying to figure out how to show the title of the parent post wither on the parent or child of parent.
Ie: Page parent About > child Contact > child 2 "Staff"
The nav will say:
About
- Contact
- Staff
No matter if on "about" or "contact" or "Staff"
I have:
post_parent) {
$parent_title = get_the_title($post_parent );
echo $parent_title;
Works great when in child, but does not show when in parent.
Any suggestions?
Ie: Page parent About > child Contact > child 2 "Staff"
The nav will say:
About
- Contact
- Staff
No matter if on "about" or "contact" or "Staff"
I have:
post_parent) {
$parent_title = get_the_title($post_parent
echo $parent_title;
Works great when in child, but does not show when in parent.
Any suggestions?
post_parent) {
$parent_title = get_the_title($post_parent);
echo $parent_title;
ASKER
thanks jester,
ok, i see i did refer to it as post once, oops.
ok, i see i did refer to it as post once, oops.
ASKER
http://wordpress.org/extend/plugins/wp-pagesnav/
pagesNav looks promising and I might use in the future, however, I am really looking for the correct php for the statement.
Something like.. if page has parent echo parent else echo page title
pagesNav looks promising and I might use in the future, however, I am really looking for the correct php for the statement.
Something like.. if page has parent echo parent else echo page title
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
2) take a look at wp-pagesnav plugin, it will do what you are looking for, might need to tweak it a bit