Skip to content

Instantly share code, notes, and snippets.

@cjkoepke
Created January 5, 2016 02:22
Show Gist options
  • Save cjkoepke/ef16a32839725b335933 to your computer and use it in GitHub Desktop.
Save cjkoepke/ef16a32839725b335933 to your computer and use it in GitHub Desktop.
Reposition page title and keep the entry title in the loop
<?php
add_action( 'genesis_meta', 'producer_handle_titles' );
function producer_handle_titles() {
//* Default entry header markup
add_action( 'genesis_after_header', 'producer_entry_header_markup_open', 5 ); /* Function below */
add_action( 'genesis_after_header', 'genesis_do_post_title', 8 );
add_action( 'genesis_after_header', 'producer_entry_header_markup_close', 15 );
//* Replace default title on archives
if ( is_archive() || is_tag() || is_category() || is_tax() ) {
remove_action( 'genesis_after_header', 'genesis_do_post_title', 8 );
add_action( 'genesis_after_header', 'producer_output_archive_titles', 8 );
}
//* Remove default loop header
if ( ! is_singular() || is_page_template( 'page_blog.php' ) || is_home() )
return;
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment