Created
April 15, 2014 02:50
-
-
Save floroxmar/10698039 to your computer and use it in GitHub Desktop.
Add page title on blog page
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
/* | |
* Add page title on blog page | |
*/ | |
add_action( 'genesis_before_loop', 'ja_blog_page_title' ); | |
function ja_blog_page_title(){ | |
//check if it is the blog page | |
if( is_page_template( 'page_blog.php' ) ){ | |
//get the page title | |
$title = get_the_title(); | |
//* Page title wrapper | |
$wrap = 'h1'; | |
//* Build the output | |
$output = genesis_markup( array( | |
'html5' => "<{$wrap} %s>", | |
'xhtml' => sprintf( '<%s class="entry-title">%s</%s>', $wrap, $title, $wrap ), | |
'context' => 'entry-title', | |
'echo' => false, | |
) ); | |
$output .= "{$title}</{$wrap}>"; | |
echo $output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment