'
',
'close' => '
',
'content' => get_the_title( wc_get_page_id( 'shop' ) ),
'context' => 'entry-title',
) );
} elseif ( 'posts' === get_option( 'show_on_front' ) && is_home() ) {
genesis_markup( array(
'open' => '',
'close' => '
',
'content' => apply_filters( 'corporate_latest_posts_title', __( 'Latest Posts', 'yeuchaybo' ) ),
'context' => 'entry-title',
) );
} elseif ( is_404() ) {
genesis_markup( array(
'open' => '',
'close' => '
',
'content' => apply_filters( 'genesis_404_entry_title', __( 'Not found, error 404', 'yeuchaybo' ) ),
'context' => 'entry-title',
) );
} elseif ( is_search() ) {
genesis_markup( array(
'open' => '',
'close' => '
',
'content' => apply_filters( 'genesis_search_title_text', __( 'Search results for: ', 'yeuchaybo' ) ) . get_search_query(),
'context' => 'entry-title',
) );
} elseif ( is_page_template( 'page_blog.php' ) ) {
do_action( 'genesis_archive_title_descriptions', get_the_title(), '', 'posts-page-description' );
} elseif ( is_single() || is_singular() ) {
genesis_do_post_title();
}
}
add_action( 'corporate_hero_section', 'corporate_page_excerpt', 20 );
/**
* Display page excerpt.
*
* Prints the correct excerpt on a per page basis. If on the WooCommerce shop
* page then the products result count is be displayed instead of the page
* excerpt. Also, if on a single product then no excerpt will be output.
*
* @since 1.0.0
*
* @return void
*/
function corporate_page_excerpt() {
if ( class_exists( 'WooCommerce' ) && is_shop() ) {
woocommerce_result_count();
} elseif ( is_home() ) {
$id = get_option( 'page_for_posts' );
if ( has_excerpt( $id ) ) {
printf( '%s
', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( is_search() ) {
$id = get_page_by_path( 'search' );
if ( has_excerpt( $id ) ) {
printf( '%s
', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( is_404() ) {
$id = get_page_by_path( 'error-404' );
if ( has_excerpt( $id ) ) {
printf( '%s
', do_shortcode( get_the_excerpt( $id ) ) );
}
} elseif ( ( is_single() || is_singular() ) && ! is_singular( 'product' ) && has_excerpt() ) {
printf( '%s
', do_shortcode( get_the_excerpt() ) );
}
}
add_filter( 'genesis_attr_hero-section', 'corporate_hero_section_attr' );
/**
* Callback for dynamic Genesis 'genesis_attr_$context' filter.
*
* Add custom attributes for the custom filter.
*
* @since 1.0.0
*
* @param array $attr The element attributes.
*
* @return array
*/
function corporate_hero_section_attr( $attr ) {
$attr['id'] = 'hero-section';
$attr['role'] = 'banner';
return $attr;
}
add_action( 'genesis_before_content_sidebar_wrap', 'corporate_hero_section' );
/**
* Display the hero section.
*
* Conditionally outputs the opening and closing hero section markup and runs
* corporate_hero_section which all of our header functions are hooked to.
*
* @since 1.0.0
*
* @return void
*/
function corporate_hero_section() {
// Output hero section markup.
genesis_markup( array(
'open' => '',
'context' => 'hero-section',
) );
/**
* Do hero section hook.
*
* @hooked corporate_page_title - 10
* @hooked corporate_page_excerpt - 20
* @hooked genesis_do_posts_page_heading
* @hooked genesis_do_date_archive_title
* @hooked genesis_do_blog_template_heading
* @hooked genesis_do_taxonomy_title_description
* @hooked genesis_do_author_title_description
* @hooked genesis_do_cpt_archive_title_description
*/
do_action( 'corporate_hero_section' );
// Output hero section markup.
genesis_markup( array(
'close' => '
',
'context' => 'hero-section',
) );
}