Last active
August 29, 2015 14:01
-
-
Save madeinnordeste/896055c4bbf13e03160c to your computer and use it in GitHub Desktop.
Wordpress - Show post/page parent title
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($post->post_parent) { | |
$parent_title = get_the_title($post->post_parent); | |
echo $parent_title; | |
} else { | |
wp_title(''); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment