Skip to content

Instantly share code, notes, and snippets.

@chillybin
Created September 6, 2016 00:00
Show Gist options
  • Save chillybin/484e75a6bccb42167a69ee8d0b54a6f6 to your computer and use it in GitHub Desktop.
Save chillybin/484e75a6bccb42167a69ee8d0b54a6f6 to your computer and use it in GitHub Desktop.
IMC Healthcare Page Title w Breadcrumbs
<?
//* Remove Page Title
add_action( 'get_header', 'remove_titles_all_single_pages' );
function remove_titles_all_single_pages() {
if ( is_singular('page') ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
} if (is_singular('post')) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
}
//* Add Page Title
add_action('genesis_after_header', 'imc_page_header');
function imc_page_header() {
if(!is_front_page()) { ?>
<div class="page-title orange">
<div class="wrap">
<div class="breadcrumbs">
<? echo genesis_do_breadcrumbs(); ?>
</div>
<? if (is_tax() || is_category()) { ?>
<h1 class="entry-title" itemprop="headline"><? echo single_term_title( '', false ); ?></h1>
<? } else if(is_singular('imc_staff')) { ?>
<h1 class="entry-title" itemprop="headline">Staff Profiles</h1>
<? } else {
echo genesis_do_post_title();
} ?>
<div class="page-icon">
<a href="<? echo site_url(); ?>/appointments/request-an-appointment/" class="button">Request an Appointment</a>
</div>
</div>
</div>
<? }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment