Last active
August 29, 2015 14:13
-
-
Save srikat/fd3b3ecfbf0bf0c5204a to your computer and use it in GitHub Desktop.
Adding the missing Entry Footer markup in Genesis. http://sridharkatakam.com/adding-missing-entry-footer-markup-genesis/
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
| //* Remove the built-in Entry Footer markup | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
| add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_open', 5 ); | |
| /** | |
| * Echo the opening structural markup for the entry footer. | |
| * | |
| * Context: Everywhere except on static Pages. | |
| * | |
| * @author Sridhar Katakam | |
| * @link http://sridharkatakam.com/ | |
| */ | |
| function sk_entry_footer_markup_open() { | |
| if ( 'page' === get_post_type() ) { | |
| return; | |
| } | |
| printf( '<footer %s>', genesis_attr( 'entry-footer' ) ); | |
| } | |
| add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_close', 15 ); | |
| /** | |
| * Echo the closing structural markup for the entry footer. | |
| * | |
| * Context: Everywhere except on static Pages. | |
| */ | |
| function sk_entry_footer_markup_close() { | |
| if ( 'page' === get_post_type() ) { | |
| return; | |
| } | |
| echo '</footer>'; | |
| } |
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
| //* Remove the built-in Entry Footer markup | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); | |
| remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); | |
| add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_open', 5 ); | |
| /** | |
| * Echo the opening structural markup for the entry footer. | |
| * | |
| * Context: Posts (single and archives) and 'research-papers' CPT pages (single and archives). | |
| * | |
| * @author Sridhar Katakam | |
| * @link http://sridharkatakam.com/ | |
| */ | |
| function sk_entry_footer_markup_open() { | |
| if ( 'post' === get_post_type() || 'research-papers' === get_post_type() ) { | |
| printf( '<footer %s>', genesis_attr( 'entry-footer' ) ); | |
| } | |
| } | |
| add_action( 'genesis_entry_footer', 'sk_entry_footer_markup_close', 15 ); | |
| /** | |
| * Echo the closing structural markup for the entry footer. | |
| * | |
| * Context: Posts (single and archives) and 'research-papers' CPT pages (single and archives). | |
| */ | |
| function sk_entry_footer_markup_close() { | |
| if ( 'post' === get_post_type() || 'research-papers' === get_post_type() ) { | |
| echo '</footer>'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment