Skip to content

Instantly share code, notes, and snippets.

@thewebprincess
Created January 10, 2014 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewebprincess/8347670 to your computer and use it in GitHub Desktop.
Save thewebprincess/8347670 to your computer and use it in GitHub Desktop.
Here's an example of how to filter your H1 content... you can use this to add span tags around your h1 if you want more styling control, but in this case I've added in a shortcode after the title to display sharing buttons. But you could put anything in here..
<?php
add_filter( 'genesis_post_title_output', 'twp_amend_post_title_output');
/**
* Filter Genesis H1 Post Titles
*/
function twp_amend_post_title_output( $title ) {
if ( is_singular() )
$title = sprintf( '<h1 class="entry-title">%s' . do_shortcode('[ssba]') . '</h1>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
return $title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment