' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) ); } } /** * Schema for tag. */ if ( ! function_exists( 'bstone_schema_body' ) ) : /** * Adds schema tags to the body classes. * * @since 1.0.0 */ function bstone_schema_body() { // Check conditions. $is_blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; // Set up default itemtype. $itemtype = 'WebPage'; // Get itemtype for the blog. $itemtype = ( $is_blog ) ? 'Blog' : $itemtype; // Get itemtype for search results. $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; // Get the result. $result = apply_filters( 'bstone_schema_body_itemtype', $itemtype ); // Return our HTML. echo apply_filters( 'bstone_schema_body', "itemtype='http://schema.org/" . esc_html( $result ) . "' itemscope='itemscope'" ); } endif; /** * Function to get site Header */ if ( ! function_exists( 'bstone_header_markup' ) ) { /** * Site Header -
* * @since 1.0.0 */ function bstone_header_markup() { ?>
role="banner">
'; } else { $submenu_class = apply_filters( 'primary_submenu_border_class', ' submenu-with-border' ); // Primary Menu. $primary_menu_args = array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'main-header-menu st-flex st-justify-content-flex-end' . $submenu_class, 'container' => 'div', 'container_class' => 'st-main-navigation', ); // Fallback Menu if primary menu not set. $fallback_menu_args = array( 'theme_location' => 'primary', 'menu_id' => 'primary-menu', 'menu_class' => 'st-main-navigation', 'container' => 'div', 'before' => '', ); ?>
'; $html .= get_custom_logo(); $html .= ''; if ( apply_filters( 'bstone_replace_logo_width', true ) ) { remove_filter( 'wp_get_attachment_image_src', 'bstone_replace_header_logo', 10 ); remove_filter( 'wp_get_attachment_image_attributes', 'bstone_replace_header_attr', 10 ); } } if ( ! apply_filters( 'bstone_disable_site_identity', false ) ) { // Site Title. if ( $display_site_tagline ) { $tag = 'span'; if ( is_home() || is_front_page() ) { $tag = 'h1'; } $html .= '<' . $tag . ' itemprop="name" class="site-title"> '; } // Site description. if ( $site_tagline ) { $html .= '

' . esc_html( get_bloginfo( 'description' ) ) . '

'; } } $html = apply_filters( 'bstone_logo', $html, $display_site_tagline, $site_tagline ); /** * Echo or Return the Logo Markup */ if ( $echo ) { echo $html; } else { return $html; } } }// End if(). /** * Replace heade logo. */ if ( ! function_exists( 'bstone_replace_header_logo' ) ) : /** * Replace header logo. * * @param array $image Size. * @param int $attachment_id Image id. * @param sting $size Size name. * @param string $icon Icon. * * @return array Size of image */ function bstone_replace_header_logo( $image, $attachment_id, $size, $icon ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( ! is_customize_preview() && $custom_logo_id == $attachment_id && 'full' == $size ) { $data = wp_get_attachment_image_src( $attachment_id, 'bst-logo-size' ); if ( false != $data ) { $image = $data; } } return $image; } endif; // End if(). /** * Function to check if it is Internet Explorer */ if ( ! function_exists( 'bstone_replace_header_attr' ) ) : /** * Replace header logo. * * @param array $attr Image. * @param object $attachment Image obj. * @param sting $size Size name. * * @return array Image attr. */ function bstone_replace_header_attr( $attr, $attachment, $size ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( $custom_logo_id == $attachment->ID ) { if ( ! is_customize_preview() ) { $attach_data = wp_get_attachment_image_src( $attachment->ID, 'bst-logo-size' ); if ( isset( $attach_data[0] ) ) { $attr['src'] = $attach_data[0]; } } $retina_logo = bstone_options( 'bst-header-retina-logo' ); $attr['srcset'] = ''; if ( apply_filters( 'bstone_main_header_retina', true ) && '' !== $retina_logo ) { $cutom_logo = wp_get_attachment_image_src( $custom_logo_id , 'full' ); $cutom_logo_url = $cutom_logo[0]; if ( bstone_check_is_ie() ) { // Replace header logo url to retina logo url. $attr['src'] = $retina_logo; } $attr['srcset'] = $cutom_logo_url . ' 1x, ' . $retina_logo . ' 2x'; } } return $attr; } endif; // End if(). /** * Function to check if it is Internet Explorer */ if ( ! function_exists( 'bstone_check_is_ie' ) ) : /** * Function to check if it is Internet Explorer. * * @return true | false boolean */ function bstone_check_is_ie() { $is_ie = false; $ua = htmlentities( $_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8' ); if ( strpos( $ua, 'Trident/7.0' ) !== false ) { $is_ie = true; } return apply_filters( 'bstone_check_is_ie', $is_ie ); } endif; /** * Function to get Toggle Button Markup */ if ( ! function_exists( 'bstone_toggle_buttons_markup' ) ) { /** * Toggle Button Markup * * @since 1.0.0 */ function bstone_toggle_buttons_markup() { $disable_primary_navigation = bstone_options( 'disable-primary-nav' ); $custom_header_rt_section = bstone_options( 'header-main-rt-section' ); $custom_header_lt_section = bstone_options( 'header-main-lt-section' ); $bst_header_type = bstone_options( 'header-layouts' ); $menu_bottons = true; if( 'header-main-layout-1' == $bst_header_type && $disable_primary_navigation && 'none' == $custom_header_rt_section ) { $menu_bottons = false; } if ( 'header-main-layout-2' == $bst_header_type && $disable_primary_navigation && 'none' == $custom_header_rt_section && 'none' == $custom_header_lt_section ) { $menu_bottons = false; } if ( apply_filters( 'bstone_enable_mobile_menu_buttons', $menu_bottons ) ) { ?>
'; return apply_filters( 'bstone_get_search', $search_html ); } } /** * Get custom HTML added by user. */ if ( ! function_exists( 'bstone_get_custom_html' ) ) { function bstone_get_custom_html( $option_name = '' ) { $custom_html = ''; $custom_html_content = bstone_options( $option_name ); if ( ! empty( $custom_html_content ) ) { $custom_html = '
' . do_shortcode( $custom_html_content ) . '
'; } elseif ( current_user_can( 'edit_theme_options' ) ) { $custom_html = '' . __( 'Add Custom HTML', 'bstone' ) . ''; } return $custom_html; } } /** * Get Widget added by user. */ if ( ! function_exists( 'bstone_get_custom_widget' ) ) { function bstone_get_custom_widget( $option_name = '' ) { ob_start(); if ( 'header-main-rt-section' == $option_name ) { $widget_id = 'header-widget-1'; } else if ( 'header-main-rt-section-2' == $option_name ) { $widget_id = 'header-widget-2'; } echo '
'; bstone_get_sidebar( $widget_id ); echo '
'; return ob_get_clean(); } } /** * Display Sidebars */ if ( ! function_exists( 'bstone_get_sidebar' ) ) { /** * Get Sidebar * * @since 1.0.0 * @param string $sidebar_id Sidebar Id. * @return void */ function bstone_get_sidebar( $sidebar_id ) { if ( is_active_sidebar( $sidebar_id ) ) { dynamic_sidebar( $sidebar_id ); } elseif ( current_user_can( 'edit_theme_options' ) ) { ?>

'>

'>

* * @since 1.0.0 */ function bstone_footer_markup() { ?> "; the_posts_pagination( array( 'prev_text' => bstone_options( 'pagination-text-prev' ), 'next_text' => bstone_options( 'pagination-text-next' ), ) ); echo ''; $output = ob_get_clean(); echo apply_filters( 'bstone_pagination_markup', $output ); } } }// End if(). add_action( 'bstone_pagination', 'bstone_number_pagination' ); /** * Bstone entry header class. */ if ( ! function_exists( 'bstone_entry_header_class' ) ) { /** * Bstone entry header class * * @since 1.0.0 */ function bstone_entry_header_class() { $post_id = bstone_get_post_id(); $classes = array(); $title_markup = bstone_the_title( '', '', $post_id, false ); $thumb_markup = bstone_get_post_thumbnail( '', '', false ); $post_meta_markup = bstone_single_get_post_meta( '', '', false ); if ( empty( $title_markup ) && empty( $thumb_markup ) && ( is_page() || empty( $post_meta_markup ) ) ) { $classes[] = 'bst-header-without-markup'; } else { if ( empty( $title_markup ) ) { $classes[] = 'bst-no-title'; } if ( empty( $thumb_markup ) ) { $classes[] = 'bst-no-thumbnail'; } if ( is_page() || empty( $post_meta_markup ) ) { $classes[] = 'bst-no-meta'; } } $classes = array_unique( apply_filters( 'bstone_entry_header_class', $classes ) ); $classes = array_map( 'sanitize_html_class', $classes ); echo esc_attr( join( ' ', $classes ) ); } }// End if(). /** * Return schema markup * * @since 1.0.0 */ if ( ! function_exists( 'bstone_schema_markup' ) ) { function bstone_schema_markup( $location ) { // Return if disable if ( false == bstone_options( 'bstone-schema-markup' ) ) { return ''; } // Default $schema = $itemprop = $itemtype = ''; // HTML if ( 'html' == $location ) { if ( is_singular() ) { $schema = 'itemscope itemtype="http://schema.org/WebPage"'; } else { $schema = 'itemscope itemtype="http://schema.org/Article"'; } } // Header elseif ( 'header' == $location ) { $schema = 'itemscope="itemscope" itemtype="http://schema.org/WPHeader"'; } // Logo elseif ( 'logo' == $location ) { $schema = 'itemscope itemtype="http://schema.org/Brand"'; } // Navigation elseif ( 'site_navigation' == $location ) { $schema = 'itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"'; } // Main elseif ( 'main' == $location ) { $itemtype = 'http://schema.org/WebPageElement'; $itemprop = 'mainContentOfPage'; if ( is_singular( 'post' ) ) { $itemprop = ''; $itemtype = 'http://schema.org/Blog'; } } // Breadcrumb elseif ( 'breadcrumb' == $location ) { $schema = 'itemscope itemtype="http://schema.org/BreadcrumbList"'; } // Breadcrumb list elseif ( 'breadcrumb_list' == $location ) { $schema = 'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"'; } // Breadcrumb itemprop elseif ( 'breadcrumb_itemprop' == $location ) { $schema = 'itemprop="breadcrumb"'; } // Sidebar elseif ( 'sidebar' == $location ) { $schema = 'itemscope="itemscope" itemtype="http://schema.org/WPSideBar"'; } // Footer widgets elseif ( 'footer' == $location ) { $schema = 'itemscope="itemscope" itemtype="http://schema.org/WPFooter"'; } // Headings elseif ( 'headline' == $location ) { $schema = 'itemprop="headline"'; } // Posts elseif ( 'entry_content' == $location ) { $schema = 'itemprop="text"'; } // Publish date elseif ( 'publish_date' == $location ) { $schema = 'itemprop="datePublished" pubdate'; } // Author name elseif ( 'author_name' == $location ) { $schema = 'itemprop="name"'; } // Author link elseif ( 'author_link' == $location ) { $schema = 'itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person"'; } // Url elseif ( 'url' == $location ) { $schema = 'itemprop="url"'; } // Position elseif ( 'position' == $location ) { $schema = 'itemprop="position"'; } // Image elseif ( 'image' == $location ) { $schema = 'itemprop="image"'; } return ' ' . apply_filters( 'bstone_schema_markup', $schema ); } }// End if(). /** * Get single post/page title */ if ( ! function_exists( 'bstone_single_title' ) ) { /** * Function to get post/page title * * @since 1.0.0 */ function bstone_single_title() { // Default title is null $title = NULL; // Get post ID $post_id = bstone_get_post_id(); // Homepage - display blog description if not a static page if ( is_front_page() && ! is_singular( 'page' ) ) { if ( get_bloginfo( 'description' ) ) { $title = get_bloginfo( 'description' ); } else { return esc_html__( 'Recent Posts', 'bstone' ); } // Homepage posts page } elseif ( is_home() && ! is_singular( 'page' ) ) { $title = get_the_title( get_option( 'page_for_posts', true ) ); } // Search needs to go before archives elseif ( is_search() ) { global $wp_query; $title = ''. $wp_query->found_posts .' '. esc_html__( 'Search Results Found', 'bstone' ); } // Archives elseif ( is_archive() ) { // Author if ( is_author() ) { $title = get_the_archive_title(); } // Post Type archive title elseif ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } // Daily archive title elseif ( is_day() ) { $title = sprintf( esc_html__( 'Daily Archives: %s', 'bstone' ), get_the_date() ); } // Monthly archive title elseif ( is_month() ) { $title = sprintf( esc_html__( 'Monthly Archives: %s', 'bstone' ), get_the_date( esc_html_x( 'F Y', 'Page title monthly archives date format', 'bstone' ) ) ); } // Yearly archive title elseif ( is_year() ) { $title = sprintf( esc_html__( 'Yearly Archives: %s', 'bstone' ), get_the_date( esc_html_x( 'Y', 'Page title yearly archives date format', 'bstone' ) ) ); } // Categories/Tags/Other else { // Get term title $title = single_term_title( '', false ); // Fix for plugins that are archives but use pages if ( ! $title ) { global $post; $title = get_the_title( $post_id ); } } } // End is archive check // 404 Page elseif ( is_404() ) { $title = esc_html__( '404: Page Not Found', 'bstone' ); } // Anything else with a post_id defined elseif ( $post_id ) { // Single Pages if ( is_singular( 'page' ) || is_singular( 'attachment' ) ) { $title = get_the_title( $post_id ); } // Single blog posts elseif ( is_singular( 'post' ) ) { if ( true == bstone_options( 'post-title-display-option' ) ) { $title = get_the_title(); } else { $title = esc_html__( 'Blog', 'bstone' ); } } // Other posts else { $title = get_the_title( $post_id ); } } // Last check if title is empty $title = $title ? $title : get_the_title(); // Apply filters and return title return apply_filters( 'bstone_single_title', $title ); } } /** * Function to get scroll to top button */ if ( ! function_exists( 'bstone_scroll_to_top_markup' ) ) { /** * Scroll to top button * * @since 1.1.2 */ function bstone_scroll_to_top_markup() { if( true == bstone_options( 'bstone-enable-scroll-top' ) ): ?> $posts_num, 'post_type' => 'post', 'post_status' => 'publish', ); if( 'category' == $data_source ) { $posts_args['category'] = esc_html( bstone_options( 'bp-banner-data-category' ) ); } else if( 'posts' == $data_source ) { $bp_posts_ids = esc_html( bstone_options( 'bp-banner-data-postid' ) ); $posts_args['post__in'] = explode( ",", $bp_posts_ids ); } $bp_posts_args = apply_filters( 'bstone_posts_banner_qry_args', $posts_args ); $posts_array = get_posts( $bp_posts_args ); /** * Banner Html Markup */ if( $posts_array ) { $banner_content .= '
'; $banner_content .= '
'; /** * Get Posts Grid Banner */ if( 'posts-grid' == $banner_type ) { $banner_content .= '
'; $bp_grid_item_count = 0; foreach ($posts_array as $post) : if (has_post_thumbnail( $post->ID ) ): $bp_grid_item_count++; $bp_grid_size_class = ''; if( 1 == $bp_grid_item_count ) { $banner_content .= '
'; } if( 2 == $bp_grid_item_count ) { $banner_content .= '
'; } if( 2 == $bp_grid_item_count || 3 == $bp_grid_item_count ) { $banner_content .= '
'; $banner_content .= '
'; } $banner_content .='
'; if( $banner_structure ) { $element_count = 0; foreach ($banner_structure as $element) : $element_count++; switch ( $element ) { case 'title': $banner_content .= '

' . get_the_title( $post->ID ) . '

'; break; case 'category': $banner_content .= bstone_posts_banner_category_markup( $post ); break; case 'meta': $banner_content .= bstone_posts_banner_meta_markup( $post ); break; } if( $element_count != count( $banner_structure ) ) { $banner_content .= ''; } endforeach; } $banner_content .= '
'; $banner_content .= get_the_post_thumbnail( $post->ID, bstone_options( 'bp-banner-imgsize' ) ); if( 2 == $bp_grid_item_count || 3 == $bp_grid_item_count ) { $banner_content .= '
'; } if( 1 == $bp_grid_item_count ) { $banner_content .= '
'; } if( 3 == $bp_grid_item_count ) { $banner_content .= '
'; } endif; endforeach; $banner_content .= '
'; } /** * Get Posts Slider Banner */ else { $banner_content .= ''; } $banner_content .= '
'; $banner_content .= '
'; } endif; } // Apply filters $banner_markup = apply_filters( 'bstone_posts_banner_markup', $banner_content ); echo $banner_markup; } } add_action('bstone_single_header', 'bstone_posts_banner_markup', 20); /** * Function to get posts banner / slider categories markup */ if ( ! function_exists( 'bstone_posts_banner_category_markup' ) ) { /** * Posts banner / slider Categories * * @since 1.1.2 */ function bstone_posts_banner_category_markup( $post ) { $category_content = ''; $categories = get_the_category( $post->ID ); if( $categories ) { $bpb_cat_shadow = ''; if( true == bstone_options( 'bp-banner-cat-shadow' ) ) { $bpb_cat_shadow = 'shadow'; } $category_content .= '
'; $bpb_cat_count = 0; foreach ( $categories as $category ) { $bpb_cat_count++; if( $bpb_cat_count > 1 ) { $category_content .= ''; } $category_content .= '' . $category->name . ''; } $category_content .= '
'; } return apply_filters( 'bstone_posts_banner_category_markup', $category_content ); } } /** * Function to get posts banner / slider meta markup */ if ( ! function_exists( 'bstone_posts_banner_meta_markup' ) ) { /** * Posts banner / slider Meta * * @since 1.1.2 */ function bstone_posts_banner_meta_markup( $post ) { $banner_mata_structure = bstone_options( 'bp-banner-meta-structure' ); $meta_icons = bstone_options( 'display-meta-icons' ); $meta_icons_type = bstone_options( 'meta-icons-type' ); $meta_icons_status = bstone_options( 'bstone-font-awesome-icons' ); $meta_icons_type_r = bstone_options( 'bstone-font-awesome-regular' ); $meta_icons_type_s = bstone_options( 'bstone-font-awesome-solid' ); $bst_meta_icons_typ = ''; if( true == $meta_icons_status ) { if( true == $meta_icons_type_r ) { $bst_meta_icons_typ = 'far'; } else if( true == $meta_icons_type_s ) { $bst_meta_icons_typ = 'fas'; } if( 'regular' == $meta_icons_type && true == $meta_icons_type_r ) { $bst_meta_icons_typ = 'far'; } else if( 'solid' == $meta_icons_type && true == $meta_icons_type_s ) { $bst_meta_icons_typ = 'fas'; } } $meta_content = ''; if( $banner_mata_structure ) { $bpb_meta_shadow = ''; if( true == bstone_options( 'bp-banner-meta-shadow' ) ) { $bpb_meta_shadow = 'shadow'; } $meta_content .= '
'; foreach( $banner_mata_structure as $index => $element ): if( count( $banner_mata_structure) > 1 && $index != 0 ) : $meta_content .= ''.esc_html( bstone_options( 'blog-meta-separator' ) ).''; endif; switch ( $element ) { case 'comments': $meta_content .= bstone_entry_meta_comments( $meta_icons, $bst_meta_icons_typ, $meta_icons_status ); break; case 'date': $meta_content .= bstone_entry_meta_date( $meta_icons, $bst_meta_icons_typ, $meta_icons_status ); break; case 'author': $meta_content .= bstone_entry_meta_author_by_post_id( $meta_icons, $bst_meta_icons_typ, $meta_icons_status, $post->ID ); break; case 'category': $meta_content .= bstone_entry_meta_category( $meta_icons, $bst_meta_icons_typ, $meta_icons_status ); break; case 'tag': $meta_content .= bstone_entry_meta_tag( $meta_icons, $bst_meta_icons_typ, $meta_icons_status ); break; } endforeach; $meta_content .= '
'; } return apply_filters( 'bstone_posts_banner_meta_markup', $meta_content ); } } /** * Comments and pingbacks * * @since 1.1.4 */ if ( ! function_exists( 'bst_comment_list_markup' ) ) { function bst_comment_list_markup( $comment, $args, $depth ) { ?>
  • id="comment-">
    $depth, 'max_depth' => $args['max_depth']))) ?>
    comment_approved == '0') : ?>