Created
January 17, 2014 03:40
-
-
Save SmartWizardSolutions/8468002 to your computer and use it in GitHub Desktop.
Move Genesis Page Title Above Content/Sidebar Using New HTML5 hooks.
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 | |
//Moves titles above content and sidebar | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
add_action( 'genesis_after_header', 'genesis_do_post_title', 20 ); | |
//this removes post titles from blog archive pages as well | |
//Add titles back to home page, single posts, categeory archives and one specific page | |
add_action('get_header', 'move_other_post_titles'); | |
function move_other_post_titles() { | |
if (is_home() || is_single() || is_page('contact-me') || is_category()) { // added conditional 'or is_single' and 'or is_category' | |
remove_action( 'genesis_after_header', 'genesis_do_post_title', 20 ); | |
add_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment