'custom_title', 'enabled' => true, ]; $default_hero_elements[] = [ 'id' => 'custom_description', 'enabled' => true, ]; if ( ( is_singular() || is_author() ) && ! ( function_exists('is_bbpress') && ( get_post_type() === 'forum' || get_post_type() === 'topic' || get_post_type() === 'reply' ) ) ) { $default_hero_elements[] = [ 'id' => 'custom_meta', 'enabled' => ! $is_page, ]; } if (is_author()) { $default_hero_elements[] = [ 'id' => 'author_social_channels', 'enabled' => true, ]; } $default_hero_elements[] = [ 'id' => 'breadcrumbs', 'enabled' => false, ]; $hero_elements = blocksy_akg_or_customizer( 'hero_elements', blocksy_get_page_title_source(), $default_hero_elements ); $meta_indexes = [ 'first' => null, 'second' => null ]; foreach ($hero_elements as $index => $single_hero_element) { if (! isset($single_hero_element['enabled'])) { continue; } if ($single_hero_element['id'] === 'custom_meta') { if ($meta_indexes['first'] === null) { $meta_indexes['first'] = $index; } else { $meta_indexes['second'] = $index; } } } foreach ($hero_elements as $index => $single_hero_element) { if (! isset($single_hero_element['enabled'])) { continue; } if (! $single_hero_element['enabled']) { continue; } do_action('blocksy:hero:' . $single_hero_element['id'] . ':before'); if ($single_hero_element['id'] === 'breadcrumbs') { $breadcrumbs_builder = new Blocksy_Breadcrumbs_Builder(); echo $breadcrumbs_builder->render(); } if ($single_hero_element['id'] === 'custom_title') { $has_author_avatar = false; if ( blocksy_akg('has_author_avatar', $single_hero_element, 'yes') === 'yes' ) { if (is_author()) { $has_author_avatar = true; } } $title = ''; $has_category_label = blocksy_akg( 'has_category_label', $single_hero_element, 'yes' ); if (function_exists('is_woocommerce') && is_woocommerce()) { $has_category_label = 'no'; } if ( ( is_singular() || blocksy_is_page() ) && ! is_search() ) { if (! $post_id) { $post_id = get_the_ID(); } if (! empty(get_the_title($post_id))) { $title = get_the_title($post_id); } } else { if (! is_search()) { if (! empty(get_the_archive_title())) { $title = get_the_archive_title(); if (function_exists('is_shop') && is_shop()) { if (strpos($title, ':') !== false) { $title_pieces = explode(':', $title, 2); $title = $title_pieces[1]; } } if (strpos($title, ':') !== false) { $title_pieces = explode(':', $title, 2); $title = '' . $title_pieces[0] . '' . $title_pieces[1]; if ($has_category_label !== 'yes') { $title = $title_pieces[1]; } } } if (is_author()) { $title = get_the_author_meta('display_name'); } } else { $title = sprintf( // translators: %s is the number of results __( 'Search Results for %s', 'blocksy' ), get_search_query() ); } if (!have_posts()) { // $title = __('Nothing Found', 'blocksy'); } } if (is_home() && is_front_page()) { $title = blocksy_akg( 'title', $single_hero_element, ( function_exists('is_shop') && is_shop() ) ? __('Products', 'blocksy') : __('Home', 'blocksy') ); } if (! empty($title)) { $title = blocksy_html_tag( blocksy_akg('heading_tag', $single_hero_element, 'h1'), array_merge([ 'class' => 'page-title', ], blocksy_schema_org_definitions('headline', [ 'array' => true ])), $title ); } if (is_author()) { echo '
'; } } if ($single_hero_element['id'] === 'custom_description') { $description = ''; $description_class = 'page-description'; $description_class .= ' ' . blocksy_visibility_classes( blocksy_akg( 'description_visibility', $single_hero_element, [ 'desktop' => true, 'tablet' => true, 'mobile' => false, ] ) ); if (is_singular() || blocksy_is_page()) { if (! $post_id) { $post_id = get_the_ID(); } if (has_excerpt($post_id)) { $description = blocksy_entry_excerpt( 40, $description_class, $post_id ); } } else { if (! is_search()) { if (! empty(get_the_archive_description())) { $description = '