-
-
Save nickdavis/424c440bd4f48ca0a4ad to your computer and use it in GitHub Desktop.
Parent Title everywhere but HOME (http://www.studiopress.com/forums/topic/parent-title-everywhere-but-home/)
This file contains 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 | |
//* ***** PARENT TITLE AFTER HEADER | |
add_action( 'genesis_after_header', 'cw_title' ); | |
function cw_title() { | |
if ( ! is_front_page() || ! is_home() ) { | |
global $post; | |
$parent_title = get_the_title( $post->post_parent ); | |
echo '<div class="parent-title"><h1>' .$parent_title. '</h1></div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment