Created
September 6, 2016 09:01
-
-
Save SiGaCode/1b636801b4b0f4e1e9e068bac69704fa to your computer and use it in GitHub Desktop.
Title and breadcrumbs sharing same div in Genesis (sample, needs to be edited).
Credits: https://gist.github.com/chillybin/484e75a6bccb42167a69ee8d0b54a6f6 (Nicol Shaan)
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 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