screen->get_prefix(); $default_hero_elements = []; $default_hero_elements[] = [ 'id' => 'custom_title', 'enabled' => $prefix !== 'product', ]; $default_hero_elements[] = [ 'id' => 'custom_description', 'enabled' => $prefix !== 'product', ]; if ( ( is_singular() || is_author() ) && ! ( function_exists('is_bbpress') && ( get_post_type() === 'forum' || get_post_type() === 'topic' || get_post_type() === 'reply' ) ) && ! (get_post_type() === 'elementor_library') ) { $default_hero_elements[] = [ 'id' => 'custom_meta', 'enabled' => ! $is_page && $prefix !== 'product', ]; } if (is_author()) { $default_hero_elements[] = [ 'id' => 'author_social_channels', 'enabled' => true, ]; } $default_hero_elements[] = [ 'id' => 'breadcrumbs', 'enabled' => $prefix === 'product', ]; $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'); do_action('blocksy:hero:element:render', $single_hero_element); if ($single_hero_element['id'] === 'breadcrumbs') { $breadcrumbs_builder = new Blocksy_Breadcrumbs_Builder(); do_action('blocksy:hero:breadcrumbs:before'); echo $breadcrumbs_builder->render(); do_action('blocksy:hero:breadcrumbs:after'); } 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 = wp_strip_all_tags(get_the_archive_title()); $divider_symbol = ':'; if (strpos($title, ':') !== false) { $divider_symbol = ':'; } if (function_exists('is_shop') && is_shop()) { if (strpos($title, $divider_symbol) !== false) { $title_pieces = explode($divider_symbol, $title, 2); $title = $title_pieces[1]; } } if (strpos($title, $divider_symbol) !== false) { $title_pieces = explode($divider_symbol, $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', blocksy_get_author_id()); } } 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_translate_dynamic(blocksy_akg( 'title', $single_hero_element, ( function_exists('is_shop') && is_shop() ) ? __('Products', 'blocksy') : __('Home', 'blocksy') ), $prefix . '_hero_custom_title'); } if (! empty($title)) { $title = blocksy_html_tag( blocksy_akg('heading_tag', $single_hero_element, 'h1'), array_merge([ 'class' => 'page-title', 'title' => strip_tags($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() || $is_page ) && ! is_search() ) { if (! $post_id) { $post_id = $is_page ? $is_page : get_the_ID(); } if (function_exists('is_woocommerce') && is_shop()) { ob_start(); woocommerce_taxonomy_archive_description(); woocommerce_product_archive_description(); $description = ob_get_clean(); } 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 = '