%3$s ', tag_escape( $site_title_tag ), esc_url( $site_url ), esc_html( $site_title ), blogun_get_schema_markup( 'name' ), blogun_get_schema_markup( 'url' ) ) ); } // Output site description if enabled in Customizer. if ( $display_site_description ) { $site_description_output = apply_filters( 'blogun_site_description_markup', sprintf( '

%1$s

', esc_html( blogun_get_site_description() ), blogun_get_schema_markup( 'description' ) ) ); } $site_title_output = '
' . $site_title_output . $site_description_output . '
'; // Allow output to be filtered. $output = apply_filters( 'blogun_logo_output', $site_title_output ); // Echo or return the output. if ( $echo ) { echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $output; } } endif; if ( ! function_exists( 'blogun_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 blogun_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'] = 'blogun-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 : blogun_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( blogun_get_site_url() ), esc_attr( trim( $class ) ), blogun_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, blogun_get_schema_markup( 'logo' ) ); } return $output; } endif; if ( ! function_exists( 'blogun_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 blogun_edit_post_link( $text, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) { if ( apply_filters( 'blogun_edit_post_link', true ) && get_edit_post_link() ) { edit_post_link( $text, $before, $after, $id, $class ); } } endif; if ( ! function_exists( 'blogun_page_header_title' ) ) : /** * Output the Page Header title tag. * * @since 1.0.0 * @param boolean $echo Display or return the title. */ function blogun_page_header_title( $echo = true ) { $title = apply_filters( 'blogun_page_header_title', blogun_get_the_title() ); $tag = apply_filters( 'blogun_page_header_title_tag', 'h1' ); $class = array( 'page-title' ); $class = apply_filters( 'blogun_page_header_title_class', $class ); if ( ! empty( $class ) ) { $class = ' class="' . esc_attr( trim( implode( ' ', $class ) ) ) . '"'; } else { $class = ''; } $before = '<' . tag_escape( $tag ) . $class . blogun_get_schema_markup( 'headline' ) . '>'; $after = ''; $title = $before . wp_kses( $title, blogun_get_allowed_html_tags() ) . $after; if ( $echo ) { echo $title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { return $title; } } endif; if ( ! function_exists( 'blogun_hamburger' ) ) : /** * Output the hamburger button. * * @since 1.0.0 * * @param string $button_title Menu title. * @param string $menu_id Menu ID. */ function blogun_hamburger( $button_title, $menu_id ) { $classes = array( 'blogun-hamburger', 'hamburger--spin', 'blogun-hamburger-' . esc_attr( $menu_id ) ); $classes = apply_filters( 'blogun_hamburger_menu_classes', $classes ); $classes = trim( implode( ' ', $classes ) ); ?> max_num_pages <= 1 ) { return; } ?>
2, 'prev_text' => blogun_animated_arrow( 'left', 'button', false ) . '' . __( 'Previous page', 'blogun' ) . '', 'next_text' => '' . __( 'Next page', 'blogun' ) . '' . blogun_animated_arrow( 'right', 'button', false ), ) ); ?>
'', 'link_before' => '', 'link_after' => '', ) ); } endif; if ( ! function_exists( 'blogun_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( 'blogun_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 blogun_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( blogun_option( 'excerpt_length' ) ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound } if ( null === $more ) { $more = apply_filters( 'excerpt_more', blogun_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( 'blogun_entry_meta_author' ) ) : /** * Prints HTML with meta information about theme author. * * @since 1.0.0 * @param array $args Author meta arguments. */ function blogun_entry_meta_author( $args = array() ) { $defaults = array( 'show_avatar' => is_single() && blogun_option( 'single_entry_meta_icons' ) || ! is_single() && blogun_option( 'entry_meta_icons' ), 'user_id' => get_post_field( 'post_author', get_the_ID() ), ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'blogun_entry_meta_author_args', $args ); ?> > true, 'show_modified' => false, 'modified_label' => esc_html__( 'Last updated on', 'blogun' ), 'date_format' => '', 'before' => '', 'after' => '', ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'blogun_entry_date_args', $args ); // Icon. $icon = blogun()->icons->get_meta_icon( 'date', blogun()->icons->get_svg( 'clock', 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 ) ), blogun_get_schema_markup( 'datePublished' ), $icon . esc_html( get_the_date( $args['date_format'] ) ), esc_attr( get_the_modified_date( DATE_W3C ) ), blogun_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'] ), blogun_get_allowed_html_tags() ); } endif; if ( ! function_exists( 'blogun_entry_meta_comments' ) ) : /** * Prints HTML with meta information for the comments. * * @since 1.0.0 */ function blogun_entry_meta_comments() { $icon = blogun()->icons->get_meta_icon( 'comments', blogun()->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, blogun_get_allowed_html_tags( 'post' ) ) . esc_html__( 'No Comments', 'blogun' ), wp_kses( $icon, blogun_get_allowed_html_tags( 'post' ) ) . esc_html__( '1 Comment', 'blogun' ), wp_kses( $icon, blogun_get_allowed_html_tags( 'post' ) ) . esc_html__( '% Comments', 'blogun' ), 'comments-link' ); echo ''; } } endif; if ( ! function_exists( 'blogun_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 blogun_entry_meta_category( $sep = ', ', $show_icon = true, $return = false ) { $categories_list = get_the_category_list( $sep ); $output = ''; // Icon. $icon = $show_icon ? blogun()->icons->get_meta_icon( 'category', blogun()->icons->get_svg( 'bookmark', array( 'aria-hidden' => 'true' ) ) ) : ''; if ( $categories_list ) { /* translators: 1: posted in label, only visible to screen readers. 2: list of categories. */ $output = wp_kses( apply_filters( 'blogun_entry_meta_category', sprintf( '%1$s%3$s%2$s', __( 'Posted in', 'blogun' ), '' . $categories_list . '', $icon ) ), blogun_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( 'blogun_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 blogun_entry_meta_tag( $before = '', $sep = ', ', $after = '', $id = 0, $show_icon = true ) { $icon = $show_icon ? blogun()->icons->get_meta_icon( 'tags', blogun()->icons->get_svg( 'tag', array( 'aria-hidden' => 'true' ) ) ) : ''; // Add icon. $before = $before . wp_kses( $icon, blogun_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( 'blogun_entry_meta_tag', sprintf( $tag_string, __( 'Tags:', 'blogun' ), $tags_list ) ), blogun_get_allowed_html_tags() ); } } endif; if ( ! function_exists( 'blogun_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 blogun_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 = blogun_get_video_from_post( $post ); break; case 'audio': $return = do_shortcode( blogun_get_audio_from_post( $post ) ); break; case 'gallery': $gallery = blogun_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 = blogun_option( 'blog_image_size' ); $caption = false; if ( is_single( $post ) || is_page( $post ) ) { $caption = true; if ( 'no-sidebar' === blogun_get_sidebar_position( $post ) ) { $size = 'full'; } } if ( has_post_thumbnail( $post ) ) { $return = blogun_get_post_thumbnail( $post, $size, $caption ); } elseif ( 'image' === $post_format ) { $return = blogun_get_image_from_post( $post ); } break; } return apply_filters( 'blogun_get_post_media', $return, $post_format, $post ); } endif; if ( ! function_exists( 'blogun_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 blogun_post_media( $post_format = false ) { echo blogun_get_post_media( $post_format ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif; if ( ! function_exists( 'blogun_top_bar_widget_text' ) ) : /** * Outputs the top bar text widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_top_bar_widget_text( $options ) { $content = isset( $options['content'] ) ? $options['content'] : ''; $content = apply_filters( 'blogun_dynamic_strings', $content ); echo '' . wp_kses( do_shortcode( $content ), blogun_get_allowed_html_tags() ) . ''; } endif; if ( ! function_exists( 'blogun_top_bar_widget_nav' ) ) : /** * Outputs the top bar navigation widget. * * @param array $options Array of navigation widget options. * @since 1.0.0 */ function blogun_top_bar_widget_nav( $options ) { $defaults = array( 'menu_id' => 'blogun-topbar-nav', 'container' => false, 'menu_class' => false, 'link_before' => '', 'link_after' => '', 'menu' => '', ); $options = wp_parse_args( $options, $defaults ); $options = apply_filters( 'blogun_top_bar_navigation_args', $options ); if ( empty( $options['menu'] ) ) { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { ?> '; $options['after_nav'] = ''; blogun_navigation( $options ); } endif; if ( ! function_exists( 'blogun_top_bar_widget_socials' ) ) : /** * Outputs the top bar social links widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function blogun_top_bar_widget_socials( $options ) { blogun_social_links( $options ); } endif; if ( ! function_exists( 'blogun_header_widget_socials' ) ) : /** * Outputs the header social links widget. * * @param array $options Array of widget options. * @since 1.1.0 */ function blogun_header_widget_socials( $options ) { blogun_social_links( $options ); } endif; if ( ! function_exists( 'blogun_header_widget_darkmode' ) ) : /** * Outputs the header dark mode widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_header_widget_darkmode( $options ) { echo ''; } endif; if ( ! function_exists( 'blogun_header_widget_search' ) ) : /** * Outputs the header search widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_header_widget_search( $options ) { get_template_part( 'template-parts/header/widgets/search' ); } endif; if ( ! function_exists( 'blogun_header_widget_button' ) ) : /** * Outputs the header button widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_header_widget_button( $options ) { $class = array( $options['class'] ); if ( isset( $options['style'] ) ) { $class[] = $options['style']; } $class[] = 'blogun-btn'; $class = apply_filters( 'blogun_header_widget_button_class', $class ); $class = trim( implode( ' ', $class ) ); $text = empty( $options['text'] ) ? __( 'Add Button Text', 'blogun' ) : $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, esc_html( $text ) ), blogun_get_allowed_html_tags() ); } endif; if ( ! function_exists( 'blogun_about_widget_button' ) ) : /** * Outputs About widget button. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_about_widget_button( $options ) { blogun_header_widget_button( $options ); } endif; if ( ! function_exists( 'blogun_cta_widget_button' ) ) : /** * Outputs CTA widget button. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_cta_widget_button( $options ) { blogun_header_widget_button( $options ); } endif; if ( ! function_exists( 'blogun_cta_widget_text' ) ) : /** * Outputs CTA widget text. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_cta_widget_text( $options ) { blogun_top_bar_widget_text( $options ); } endif; if ( ! function_exists( 'blogun_copyright_widget_text' ) ) : /** * Outputs the top bar text widget. * * @since 1.0.0 * @param array $options Array of widget options. */ function blogun_copyright_widget_text( $options ) { blogun_top_bar_widget_text( $options ); } endif; if ( ! function_exists( 'blogun_copyright_widget_nav' ) ) : /** * Outputs the copyright navigation widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function blogun_copyright_widget_nav( $options ) { $defaults = array( 'menu_id' => 'blogun-footer-nav', 'container' => false, 'menu_class' => false, 'link_before' => '', 'link_after' => '', 'menu' => '', ); $options = wp_parse_args( $options, $defaults ); $options = apply_filters( 'blogun_copyright_navigation_args', $options ); if ( empty( $options['menu'] ) ) { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) ) { ?> '; $options['after_nav'] = ''; blogun_navigation( $options ); } endif; if ( ! function_exists( 'blogun_copyright_widget_socials' ) ) : /** * Outputs the copyright social links widget. * * @param array $options Array of widget options. * @since 1.0.0 */ function blogun_copyright_widget_socials( $options ) { blogun_social_links( $options ); } endif; if ( ! function_exists( 'blogun_footer_widgets' ) ) : /** * Outputs the footer widgets. * * @since 1.0.0 */ function blogun_footer_widgets() { $footer_layout = blogun_option( 'footer_layout' ); $column_classes = blogun_get_footer_column_class( $footer_layout ); if ( is_array( $column_classes ) && ! empty( $column_classes ) ) { foreach ( $column_classes as $i => $column_class ) { $sidebar_id = 'blogun-footer-' . ( $i + 1 ); ?> comment_type ) { ?>
  • id="comment-">

    > ', '' ); ?>

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

    '', 'menu' => '', 'container' => 'nav', 'container_class' => 'blogun-social-nav', 'menu_class' => 'blogun-socials-menu', 'depth' => 1, 'link_before' => '', 'link_after' => '' . blogun()->icons->get_svg( 'external-link', array( 'aria-hidden' => 'true' ) ) . blogun()->icons->get_svg( 'external-link', array( 'aria-hidden' => 'true', 'class' => 'bottom-icon', ) ), 'style' => '', 'align' => '', 'size' => 'blogun-standard', ); $args = wp_parse_args( $args, $defaults ); $args = apply_filters( 'blogun_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'] .= ' ' . esc_attr( $args['size'] ); } if ( ! empty( $args['menu'] ) && is_nav_menu( $args['menu'] ) ) { wp_nav_menu( $args ); } else { echo ''; } } endif; if ( ! function_exists( 'blogun_navigation' ) ) : /** * The template tag for displaying social icons. * * @param array $args Args for wp_nav_menu function. * @since 1.0.0 * @return void */ function blogun_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( 'blogun_navigation_args', $args ); if ( ! empty( $args['menu'] ) && is_nav_menu( $args['menu'] ) ) { wp_nav_menu( $args ); } } endif; if ( ! function_exists( 'blogun_breadcrumb' ) ) : /** * Outputs breadcrumbs trail * * @param array $args Array of breadcrumb options. */ function blogun_breadcrumb( $args = array() ) { $args = wp_parse_args( $args, array( 'container_before' => '', 'container_after' => '', ) ); echo wp_kses_post( $args['container_before'] ); blogun_breadcrumb_trail( array( 'show_browse' => false, ) ); echo wp_kses_post( $args['container_after'] ); } endif; // maintenance enable function 'template redirect' function blogun_maintenance_template_redirect() { $maintenance_mode_enable = blogun_option( 'enable_maintenance' ); $make_site_live = blogun_option( 'maintenance_make_live' ); $countdown = blogun_option( 'maintenance_date_time' ); $timezone = blogun_option( 'maintenance_timezone' ); if ( $maintenance_mode_enable ) { $date = new DateTime( $countdown . ' ' . $timezone ); // $timeToString = $date->format('Y/m/d H:i:s'); $date_now = new DateTime(); // var_dump( $timeToString ); if ( $date_now > $date && $make_site_live ) { blogun()->options->set( 'blogun_enable_maintenance', false ); return; } if ( ! is_feed() ) { // if user not login page is redirect on coming soon template page if ( ! is_user_logged_in() ) { $file = get_template_directory() . '/inc/admin/maintenance.php'; include $file; exit(); } } // if user is log-in then we check role. if ( is_user_logged_in() ) { // get logined in user role global $current_user; wp_get_current_user(); $LoggedInUserID = $current_user->ID; $UserData = get_userdata( $LoggedInUserID ); // if user role not 'administrator' redirect him to message page if ( $UserData->roles[0] != 'administrator' ) { if ( ! is_feed() ) { $file = get_template_directory() . '/inc/admin/maintenance.php'; exit(); } } } } } // add action to call function icare_maintenance_template_redirect add_action( 'template_redirect', 'blogun_maintenance_template_redirect' );