%3$s ', tag_escape( $site_title_tag ), esc_url( $site_url ), esc_html( $site_title ), bloghash_get_schema_markup( 'name' ), bloghash_get_schema_markup( 'url' ), esc_attr($class) ) ); // Output site description if enabled in Customizer. $class = !$display_site_description ? ' screen-reader-text' : ''; if( bloghash_get_site_description() ) { $site_description_output = apply_filters( 'bloghash_site_description_markup', sprintf( '

%1$s

', esc_html( bloghash_get_site_description() ), bloghash_get_schema_markup( 'description' ), esc_attr($class) ) ); } $output = '
' . $site_logo_output . $site_title_output . $site_description_output . '
'; // Allow output to be filtered. $output = apply_filters( 'bloghash_logo_output', $output ); // Echo or return the output. if ( $echo ) { echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $output; } } endif; if ( ! function_exists( 'bloghash_get_logo_img_output' ) ) : /** * Outputs logo image markup. * * @param int $logo Attachment ID of the logo image. * @param int $retina Attachment ID of the retina logo image. * @param string $class Additional CSS class. * @since 1.0.0 */ function bloghash_get_logo_img_output( $logo, $retina = '', $class = '' ) { $output = ''; // Logo attributes. $logo_attr = array( 'url' => '', 'width' => '', 'height' => '', 'class' => '', 'alt' => '', ); // Check if a custom logo has been uploaded. if ( $logo ) { // Get default logo src, width & height. $default_logo_attachment_src = wp_get_attachment_image_src( $logo, 'full' ); if ( $default_logo_attachment_src ) { $logo_attr['url'] = $default_logo_attachment_src[0]; $logo_attr['width'] = $default_logo_attachment_src[1]; $logo_attr['height'] = $default_logo_attachment_src[2]; } // Check if uploaded logo is SVG. $mimes = array(); $mimes['svg'] = 'image/svg+xml'; $file_type = wp_check_filetype( $logo_attr['url'], $mimes ); $file_extension = $file_type['ext']; if ( 'svg' === $file_extension ) { $logo_attr['width'] = '100%'; $logo_attr['height'] = '100%'; $logo_attr['class'] = 'bloghash-svg-logo'; } // Get default logo alt. $default_logo_alt = get_post_meta( $logo, '_wp_attachment_image_alt', true ); $logo_attr['alt'] = $default_logo_alt ? $default_logo_alt : bloghash_get_site_title(); // Build srcset attribute. $srcset = ''; if ( $retina ) { $retina_logo_image = wp_get_attachment_image_url( $retina, 'full' ); if ( $retina_logo_image ) { $srcset = ' srcset="' . esc_attr( $logo_attr['url'] ) . ' 1x, ' . esc_attr( $retina_logo_image ) . ' 2x"'; } } // Build logo output. $output = sprintf( ' %5$s ', esc_url( bloghash_get_site_url() ), esc_attr( trim( $class ) ), bloghash_get_schema_markup( 'url' ), esc_url( $logo_attr['url'] ), esc_attr( $logo_attr['alt'] ), esc_attr( $logo_attr['width'] ), esc_attr( $logo_attr['height'] ), esc_attr( $logo_attr['class'] ), $srcset, bloghash_get_schema_markup( 'logo' ) ); } return $output; } endif; if ( ! function_exists( 'bloghash_edit_post_link' ) ) : /** * Function to get Edit Post Link * * @since 1.0.0 * * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param string $class Optional. Add custom class to link. Default 'post-edit-link'. */ function bloghash_edit_post_link( $text, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) { if ( apply_filters( 'bloghash_edit_post_link', true ) && get_edit_post_link() ) { edit_post_link( $text, $before, $after, $id, $class ); } } endif; if ( ! function_exists( 'bloghash_page_header_title' ) ) : /** * Output the Page Header title tag. * * @since 1.0.0 * @param boolean $echo Display or return the title. */ function bloghash_page_header_title( $echo = true ) { $title = apply_filters( 'bloghash_page_header_title', bloghash_get_the_title() ); $tag = apply_filters( 'bloghash_page_header_title_tag', 'h1' ); $class = array( 'page-title' ); $class = apply_filters( 'bloghash_page_header_title_class', $class ); if ( ! empty( $class ) ) { $class = ' class="' . esc_attr( trim( implode( ' ', $class ) ) ) . '"'; } else { $class = ''; } $before = '<' . tag_escape( $tag ) . $class . bloghash_get_schema_markup( 'headline' ) . '>'; $after = ''; $title = $before . wp_kses( $title, bloghash_get_allowed_html_tags() ) . $after; if ( $echo ) { echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $title; } } endif; if ( ! function_exists( 'bloghash_hamburger' ) ) : /** * Output the hamburger button. * * @since 1.0.0 * * @param string $button_title Menu title. * @param string $menu_id Menu ID. */ function bloghash_hamburger( $button_title, $menu_id ) { $classes = array( 'bloghash-hamburger', 'hamburger--spin', 'bloghash-hamburger-' . esc_attr( $menu_id ) ); $classes = apply_filters( 'bloghash_hamburger_menu_classes', $classes ); $classes = trim( implode( ' ', $classes ) ); ?> max_num_pages <= 1 ) { return; } ?>
2, 'prev_text' => sprintf( '%s', esc_html__( 'Previous page', 'bloghash' ) ) . bloghash_animated_arrow( 'left', 'button', false ), 'next_text' => sprintf( '%s', esc_html__( 'Next page', 'bloghash' ) ) . bloghash_animated_arrow( 'right', 'button', false ), ) ); ?>
'', 'link_before' => '', 'link_after' => '', ) ); } endif; if ( ! function_exists( 'bloghash_animated_arrow' ) ) : /** * Output the animated button HTML markup. * * @since 1.0.0 * @param string $style button style. Can be 'right', or 'left'. * @param string $type type attribute for '; } else { $button = ''; } if ( $echo ) { echo $button; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $button; } } endif; if ( ! function_exists( 'bloghash_excerpt' ) ) : /** * Get excerpt. * * @since 1.0.0 * @param int $length the length of the excerpt. * @param string $more What to append if $text needs to be trimmed. */ function bloghash_excerpt( $length = null, $more = null ) { global $post; // Check if this post has a custom excerpt. if ( has_excerpt( $post->ID ) ) { $output = $post->post_excerpt; } else { // Check for more tag. if ( strpos( $post->post_content, '' ) ) { $output = apply_filters( 'the_content', get_the_content() ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound } else { if ( null === $length ) { $length = apply_filters( 'excerpt_length', intval( bloghash_option( 'excerpt_length' ) ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound } if ( null === $more ) { $more = apply_filters( 'excerpt_more', bloghash_option( 'excerpt_more' ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound } $output = wp_trim_words( strip_shortcodes( $post->post_content ), $length, $more ); } } echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bloghash_entry_meta_author' ) ) : /** * Prints HTML with meta information about theme author. * * @since 1.0.0 * @param array $args Author meta arguments. */ function bloghash_entry_meta_author( $args = array() ) { $defaults = array( 'show_avatar' => is_single() && bloghash_option( 'single_entry_meta_icons' ) || ! is_single() && bloghash_option( 'entry_meta_icons' ), 'user_id' => get_post_field( 'post_author', get_the_ID() ), ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'bloghash_entry_meta_author_args', $args ); ?> > true, 'show_modified' => false, 'modified_label' => esc_html__( 'Last updated on', 'bloghash' ), 'date_format' => '', 'before' => '', 'after' => '', ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'bloghash_entry_date_args', $args ); // Icon. $icon = bloghash()->icons->get_meta_icon( 'date', bloghash()->icons->get_svg( 'calendar', array( 'aria-hidden' => 'true' ) ) ); if ( $args['show_published'] ) { if ( $args['show_modified'] && get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } else { $time_string = ''; } } elseif ( $args['show_modified'] ) { if ( get_the_time( 'U' ) === get_the_modified_time( 'U' ) ) { $time_string = ''; } else { $time_string = ''; } } $args['modified_label'] = $args['modified_label'] ? $args['modified_label'] . ' ' : ''; $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), bloghash_get_schema_markup( 'datePublished' ), $icon . esc_html( get_the_date( $args['date_format'] ) ), esc_attr( get_the_modified_date( DATE_W3C ) ), bloghash_get_schema_markup( 'dateModified' ), esc_html( $args['modified_label'] ) . esc_html( get_the_modified_date( $args['date_format'] ) ) ); echo wp_kses( sprintf( '%1$s%2$s%3$s', $args['before'], $time_string, $args['after'] ), bloghash_get_allowed_html_tags() ); } endif; if ( ! function_exists( 'bloghash_entry_meta_comments' ) ) : /** * Prints HTML with meta information for the comments. * * @since 1.0.0 */ function bloghash_entry_meta_comments() { $icon = bloghash()->icons->get_meta_icon( 'comments', bloghash()->icons->get_svg( 'message-square', array( 'aria-hidden' => 'true' ) ) ); if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; // wp_kses_post( $icon ); comments_popup_link( wp_kses( $icon, bloghash_get_allowed_html_tags( 'post' ) ) . esc_html__( 'No Comments', 'bloghash' ), wp_kses( $icon, bloghash_get_allowed_html_tags( 'post' ) ) . esc_html__( '1', 'bloghash' ), wp_kses( $icon, bloghash_get_allowed_html_tags( 'post' ) ) . esc_html__( '%', 'bloghash' ), 'comments-link' ); echo ''; } } endif; if ( ! function_exists( 'bloghash_entry_meta_category' ) ) : /** * Prints HTML with meta information for the categories. * * @since 1.0.0 * @param string $sep Category separator. * @param bool $show_icon Show an icon for the meta detail. * @param bool $return Return or output. */ function bloghash_entry_meta_category( $sep = ', ', $show_icon = true, $limit_categories = -1, $return = false ) { $categories = get_the_category(); $categories_list = ''; // Limit the number of categories if $limit_categories is provided. if ( $limit_categories > 0 && $categories ) { $categories = array_slice( $categories, 0, $limit_categories ); } if ( $categories ) { foreach ( $categories as $category ) { $category_list[] = '' . esc_html( $category->name ) . ''; } $categories_list = join( $sep, $category_list ); } $output = ''; // Icon. $icon = $show_icon ? bloghash()->icons->get_meta_icon( 'category', bloghash()->icons->get_svg( 'folder-open', array( 'aria-hidden' => 'true' ) ) ) : ''; if ( $categories_list ) { $categories_list = preg_replace_callback( '/([^<]+)<\/a>/', function( $matches ) { $category_id = get_cat_ID( $matches[2] ); $term = get_term( $category_id ); return sprintf( '%s', $matches[1], $category_id, $matches[2] ); }, $categories_list ); /* translators: 1: posted in label, only visible to screen readers. 2: list of categories. */ $output = wp_kses( apply_filters( 'bloghash_entry_meta_category', sprintf( '%1$s%3$s%2$s', __( 'Posted in', 'bloghash' ), '' . $categories_list . '', $icon ) ), bloghash_get_allowed_html_tags() ); if ( $return ) { return $output; // return is used by Core plugin for Posts widget. } else { echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } endif; if ( ! function_exists( 'bloghash_entry_meta_tag' ) ) : /** * Prints HTML with meta information for the tags. * * @since 1.0.0 * @param string $before Before entry meta tag. * @param string $sep Separator string. * @param string $after After entry meta tag. * @param int $id Post ID. * @param bool $show_icon Show an icon for the meta detail. */ function bloghash_entry_meta_tag( $before = '', $sep = ', ', $after = '', $id = 0, $show_icon = true ) { $icon = $show_icon ? bloghash()->icons->get_meta_icon( 'tags', bloghash()->icons->get_svg( 'tag', array( 'aria-hidden' => 'true' ) ) ) : ''; // Add icon. $before = $before . wp_kses( $icon, bloghash_get_allowed_html_tags() ); /* translators: used between list items, there is a space after the comma. */ $tags_list = get_the_tag_list( $before, $sep, $after, $id ); if ( $tags_list && ! post_password_required() ) { $tag_string = '%1$s %2$s'; /* translators: 1: posted in label, only visible to screen readers. 2: list of tags. */ echo wp_kses( apply_filters( 'bloghash_entry_meta_tag', sprintf( $tag_string, __( 'Tags:', 'bloghash' ), $tags_list ) ), bloghash_get_allowed_html_tags() ); } } endif; if ( ! function_exists( 'bloghash_get_post_media' ) ) : /** * Post format featured media: image / gallery / audio / video etc. * * @since 1.0.0 * @return mixed * @param string $post_format Post Format. * @param mixed $post Post object. */ function bloghash_get_post_media( $post_format = false, $post = null ) { if ( false === $post_format ) { $post_format = get_post_format( $post ); } $return = ''; switch ( $post_format ) { case 'video': $return = bloghash_get_video_from_post( $post ); break; case 'audio': $return = do_shortcode( bloghash_get_audio_from_post( $post ) ); break; case 'gallery': $gallery = bloghash_get_post_gallery( $post ); if ( isset( $gallery['ids'] ) ) { $img_ids = explode( ',', $gallery['ids'] ); if ( is_array( $img_ids ) && ! empty( $img_ids ) ) { foreach ( $img_ids as $img_id ) { $image_alt = get_post_meta( $img_id, '_wp_attachment_image_alt', true ); $image_url = wp_get_attachment_url( $img_id ); $return .= ''; $return .= '' . esc_attr( $image_alt ) . ''; $return .= ''; } } } break; case 'image': default: $size = bloghash_option( 'blog_image_size' ); $caption = false; if ( is_single( $post ) || is_page( $post ) ) { $caption = true; if ( 'no-sidebar' === bloghash_get_sidebar_position( $post ) ) { $size = 'full'; } } if ( has_post_thumbnail( $post ) ) { $return = bloghash_get_post_thumbnail( $post, $size, $caption ); } elseif ( 'image' === $post_format ) { $return = bloghash_get_image_from_post( $post ); } break; } return apply_filters( 'bloghash_get_post_media', $return, $post_format, $post ); } endif; if ( ! function_exists( 'bloghash_post_media' ) ) : /** * Print HTML format featured media: image / gallery / audio / video etc. * * @since 1.0.0 * @return mixed * @param string $post_format Post Format. */ function bloghash_post_media( $post_format = false ) { echo bloghash_get_post_media( $post_format ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'bloghash_top_bar_widget_text' ) ) : /** * Outputs the top bar text widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_top_bar_widget_text( $options ) { $content = isset( $options['content'] ) ? $options['content'] : ''; $content = apply_filters( 'bloghash_dynamic_strings', $content ); echo '' . wp_kses( do_shortcode( $content ), bloghash_get_allowed_html_tags() ) . ''; } endif; if ( ! function_exists( 'bloghash_top_bar_widget_nav' ) ) : /** * Outputs the top bar navigation widget. * * @param array $options Array of navigation widget options. * @since 1.0.0 */ function bloghash_top_bar_widget_nav( $options ) { $defaults = array( 'menu_id' => 'bloghash-topbar-nav', 'container' => false, 'menu_class' => false, 'link_before' => '', 'link_after' => '', 'menu' => '', ); $options = wp_parse_args( $options, $defaults ); $options = apply_filters( 'bloghash_top_bar_navigation_args', $options ); if ( empty( $options['menu'] ) ) { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { ?> '; $options['after_nav'] = ''; bloghash_navigation( $options ); } endif; if ( ! function_exists( 'bloghash_top_bar_widget_socials' ) ) : /** * Outputs the top bar social links widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function bloghash_top_bar_widget_socials( $options ) { bloghash_social_links( $options ); } endif; if ( ! function_exists( 'bloghash_header_widget_text' ) ) : /** * Outputs the header text widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_header_widget_text( $options ) { bloghash_top_bar_widget_text( $options ); } endif; if ( ! function_exists( 'bloghash_header_widget_advertisements' ) ) : /** * Outputs the header advertisements widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_header_widget_advertisements( $options ) { $content = isset( $options['content'] ) ? $options['content'] : ''; $content = apply_filters( 'bloghash_dynamic_strings', $content ); echo '' . wp_kses( do_shortcode( $content ), bloghash_get_allowed_html_tags() ) . ''; } endif; if ( ! function_exists( 'bloghash_header_widget_socials' ) ) : /** * Outputs the header social links widget. * * @param array $options Array of widget options. * @since 1.1.0 */ function bloghash_header_widget_socials( $options ) { bloghash_social_links( $options ); } endif; if ( ! function_exists( 'bloghash_header_widget_darkmode' ) ) : /** * Outputs the header dark mode widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_header_widget_darkmode( $options ) { if ( isset( $options['style'] ) ) { $class[] = $options['style']; } else { $class[] = 'rounded-border'; } $class = trim( implode( ' ', $class ) ); echo wp_kses( sprintf( '', esc_attr( $class ) ), bloghash_get_allowed_html_tags() ); } endif; if ( ! function_exists( 'bloghash_header_widget_search' ) ) : /** * Outputs the header search widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_header_widget_search( $options ) { get_template_part( 'template-parts/header/widgets/search' ); } endif; if ( ! function_exists( 'bloghash_header_widget_button' ) ) : /** * Outputs the header button widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_header_widget_button( $options ) { $class = array( $options['class'] ); if ( isset( $options['style'] ) ) { $class[] = $options['style']; } $class[] = 'bloghash-btn'; $class = apply_filters( 'bloghash_header_widget_button_class', $class ); $class = trim( implode( ' ', $class ) ); $text = empty( $options['text'] ) ? __( 'Add Button Text', 'bloghash' ) : $options['text']; $target = 'target="_self"'; if ( '_blank' === $options['target'] ) { $target = 'target="_blank" rel="noopener noreferrer"'; } echo wp_kses( sprintf( '%4$s', esc_url( $options['url'] ), esc_attr( $class ), $target, $text ), bloghash_get_allowed_html_tags() ); } endif; if ( ! function_exists( 'bloghash_about_widget_button' ) ) : /** * Outputs About widget button. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_about_widget_button( $options ) { bloghash_header_widget_button( $options ); } endif; if ( ! function_exists( 'bloghash_cta_widget_button' ) ) : /** * Outputs CTA widget button. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_cta_widget_button( $options ) { bloghash_header_widget_button( $options ); } endif; if ( ! function_exists( 'bloghash_cta_widget_text' ) ) : /** * Outputs CTA widget text. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_cta_widget_text( $options ) { bloghash_top_bar_widget_text( $options ); } endif; if ( ! function_exists( 'bloghash_copyright_widget_text' ) ) : /** * Outputs the top bar text widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function bloghash_copyright_widget_text( $options ) { bloghash_top_bar_widget_text( $options ); } endif; if ( ! function_exists( 'bloghash_copyright_widget_nav' ) ) : /** * Outputs the copyright navigation widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function bloghash_copyright_widget_nav( $options ) { $defaults = array( 'menu_id' => 'bloghash-footer-nav', 'container' => false, 'menu_class' => false, 'link_before' => '', 'link_after' => '', 'menu' => '', ); $options = wp_parse_args( $options, $defaults ); $options = apply_filters( 'bloghash_copyright_navigation_args', $options ); if ( empty( $options['menu'] ) ) { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { ?> '; $options['after_nav'] = ''; bloghash_navigation( $options ); } endif; if ( ! function_exists( 'bloghash_copyright_widget_socials' ) ) : /** * Outputs the copyright social links widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function bloghash_copyright_widget_socials( $options ) { bloghash_social_links( $options ); } endif; if ( ! function_exists( 'bloghash_footer_widgets' ) ) : /** * Outputs the footer widgets. * * @since 1.0.0 */ function bloghash_footer_widgets() { $footer_layout = bloghash_option( 'footer_layout' ); $column_classes = bloghash_get_footer_column_class( $footer_layout ); if ( is_array( $column_classes ) && ! empty( $column_classes ) ) { foreach ( $column_classes as $i => $column_class ) { $sidebar_id = 'bloghash-footer-' . ( $i + 1 ); ?>
%s', esc_url( $options['url'] ), esc_attr( $options['target'] ), wp_get_attachment_image( $options['image_id'], 'full' ) ); } else { echo wp_get_attachment_image( $options['image_id'], 'full' ); } ?>
', esc_attr( $classes ) ); bloghash_ad_widget_advertisements( $ad_widgets[ $ads_rendered ]['values'] ); printf( '' ); endif; } endif; if ( ! function_exists( 'bloghash_comment' ) ) : /** * Comment and pingback output function. * * @since 1.0.0 * @param string $comment Comment content. * @param array $args Comment arguments. * @param int $depth Comment depth. */ function bloghash_comment( $comment, $args, $depth ) { global $post; if ( 'pingback' === $comment->comment_type ) { ?>
  • id="comment-">

    > ', '' ); ?>

  • id="comment-">
    >
    user_id === $post->post_author ) { ?>
    $depth, 'reply_text' => $args['reply_text'], ) ) ); ?>
    comment_approved ) : ?>

    '', 'menu' => '', 'container' => 'nav', 'container_class' => 'bloghash-social-nav', 'menu_class' => 'bloghash-socials-menu', 'depth' => 1, 'link_before' => '', 'link_after' => '' . bloghash()->icons->get_svg( 'external-link', array( 'aria-hidden' => 'true' ) ) . bloghash()->icons->get_svg( 'external-link', array( 'aria-hidden' => 'true', 'class' => 'bottom-icon', ) ) . '', 'style' => '', 'size' => '', 'align' => '', ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'bloghash_social_links_args', $args ); // Add style class to container_class. if ( ! empty( $args['style'] ) ) { $args['container_class'] .= ' ' . esc_attr( $args['style'] ); } // Add alignment class to container_class. if ( ! empty( $args['align'] ) ) { $args['menu_class'] .= ' ' . esc_attr( $args['align'] ); } // Add size class to container_class. if ( ! empty( $args['size'] ) ) { $args['container_class'] .= ' bloghash-' . esc_attr( $args['size'] ); } if ( ! empty( $args['menu'] ) && is_nav_menu( $args['menu'] ) ) { wp_nav_menu( $args ); } else { echo ''; } } endif; if ( ! function_exists( 'bloghash_navigation' ) ) : /** * The template tag for displaying social icons. * * @param array $args Args for wp_nav_menu function. * @since 1.0.0 * @return void */ function bloghash_navigation( $args = array() ) { $defaults = array( 'before_nav' => '', 'after_nav' => '', ); $args = wp_parse_args( $args, $defaults ); $args['items_wrap'] = isset( $args['items_wrap'] ) ? $args['items_wrap'] : ''; $args['items_wrap'] = $args['before_nav'] . $args['items_wrap'] . $args['after_nav']; $args = apply_filters( 'bloghash_navigation_args', $args ); if ( ! empty( $args['menu'] ) && is_nav_menu( $args['menu'] ) ) { wp_nav_menu( $args ); } } endif; if ( ! function_exists( 'bloghash_breadcrumb' ) ) : /** * Outputs breadcrumbs trail * * @param array $args Array of breadcrumb options. */ function bloghash_breadcrumb( $args = array() ) { $args = wp_parse_args( $args, array( 'container_before' => '', 'container_after' => '', ) ); echo wp_kses_post( $args['container_before'] ); bloghash_breadcrumb_trail( array( 'show_browse' => false, ) ); echo wp_kses_post( $args['container_after'] ); } endif; // Outputs the header widgets in Header Widget Locations function bloghash_header_widget_output( $locations, $all_widgets ) { $header_widgets = $all_widgets; $header_class = ''; if ( ! empty( $locations ) ) { $header_widgets = array(); foreach ( $locations as $location ) { $header_class = ' bloghash-widget-location-' . $location; $header_widgets[ $location ] = array(); if ( ! empty( $all_widgets ) ) { foreach ( $all_widgets as $i => $widget ) { if ( $location === $widget['values']['location'] ) { $header_widgets[ $location ][] = $widget; } } } } } echo '
    '; if ( ! empty( $header_widgets ) ) { foreach ( $header_widgets as $location => $widgets ) { do_action( 'bloghash_header_widgets_before_' . $location ); if ( ! empty( $widgets ) ) { foreach ( $widgets as $widget ) { if ( function_exists( 'bloghash_header_widget_' . $widget['type'] ) ) { $classes = array(); $classes[] = 'bloghash-header-widget__' . esc_attr( $widget['type'] ); $classes[] = 'bloghash-header-widget'; if ( isset( $widget['values']['visibility'] ) && $widget['values']['visibility'] ) { $classes[] = 'bloghash-' . esc_attr( $widget['values']['visibility'] ); } $classes = apply_filters( 'bloghash_header_widget_classes', $classes, $widget ); $classes = trim( implode( ' ', $classes ) ); printf( '
    ', esc_attr( $classes ) ); call_user_func( 'bloghash_header_widget_' . $widget['type'], $widget['values'] ); printf( '
    ' ); } } } do_action( 'bloghash_header_widgets_after_' . $location ); } } echo '
    '; }