Skip to content

Instantly share code, notes, and snippets.

@SmartWizardSolutions
Created January 17, 2014 03:40
Show Gist options
  • Save SmartWizardSolutions/8468002 to your computer and use it in GitHub Desktop.
Save SmartWizardSolutions/8468002 to your computer and use it in GitHub Desktop.
Move Genesis Page Title Above Content/Sidebar Using New HTML5 hooks.
<?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