'; endif; } add_action( 'blog_postx_header_after_hook', 'blog_postx_progress_bar', 10 ); endif; if( ! function_exists( 'blog_postx_sticky_posts' ) ) : function blog_postx_sticky_posts(){ if( ! BPX\blog_postx_get_customizer_option( 'sticky_posts_option' ) || is_paged() || ! is_home() || ! is_front_page() ) return; $sticky_posts_position = BPX\blog_postx_get_customizer_option( 'sticky_posts_position' ); $posts_to_append = BPX\blog_postx_get_customizer_option( 'sticky_posts_posts_to_append' ); $posts_to_show = BPX\blog_postx_get_customizer_option( 'sticky_posts_to_show' ); $args[ 'sticky_posts_show_author' ] = true; $args[ 'sticky_posts_show_date' ] = true; $sectionClass = 'blog-postx-sticky-posts position-' . esc_html( $sticky_posts_position ); $posts_args = blog_postx_get_query_args( 'sticky' ); $posts_args[ 'posts_per_page' ] = absint( $posts_to_append - $posts_to_show ); ?>

have_posts() ) : $count = 0; while( ( $query_instance->have_posts() ) ) : $query_instance->the_post(); $count++; $args[ 'count' ] = $count; get_template_part( 'template-parts/content', 'sticky-posts', $args ); endwhile; endif; ?>
'; break; default: $output = ''; } return $output; } endif; if( ! function_exists( 'blog_postx_convert_number_to_numeric_string' )) : /** * Function to convert int parameter to numeric string * * @return string */ function blog_postx_convert_number_to_numeric_string( $int ) { switch( $int ){ case 2: return "two"; break; case 3: return "three"; break; case 4: return "four"; break; case 5: return "five"; break; case 6: return "six"; break; case 7: return "seven"; break; case 8: return "eight"; break; case 9: return "nine"; break; case 10: return "ten"; break; default: return "one"; } } endif; if( ! function_exists( 'blog_postx_post_read_time' ) ) : /** * Function derives the read time * @return float */ function blog_postx_post_read_time( $string = '' ) { $read_time = 0; if( empty( $string ) ) { return 0 . esc_html__( ' min', 'blog-postx' ); } else { $read_time = apply_filters( 'blog_postx_content_read_time', ceil( str_word_count( wp_strip_all_tags( $string ) ) / 200 ), 2 ); if( $read_time == 0 ) { return 1 . esc_html__( ' min', 'blog-postx' ); } else { return $read_time . esc_html__( ' mins', 'blog-postx' ); } } } endif; if( ! function_exists( 'blog_postx_get_post_categories' ) ) : /** * Function contains post categories html * @return float */ function blog_postx_get_post_categories( $post_id, $number = 1, $args = [] ) { $hide_on_mobile = ''; $n_categories = wp_get_post_categories($post_id, array( 'number' => absint( $number ) )); if( array_key_exists( 'hide_on_mobile', $args ) ) : $hide_on_mobile = ( ! $args['hide_on_mobile'] ) ? ' hide-on-mobile' : ''; endif; $tag = ( is_single() ? 'div' : 'ul' ); echo '<'. $tag .' class="post-categories'. esc_attr( $hide_on_mobile ) .'">'; foreach( $n_categories as $n_category ) : echo '
  • ' .get_cat_name( $n_category ). '
  • '; endforeach; echo ''; } endif; if( ! function_exists( 'blog_postx_loader_html' ) ) : /** * Preloader html * * @package Blog Postx Pro * @since 1.0.0 */ function blog_postx_loader_html() { if( ! BPX\blog_postx_get_customizer_option( 'preloader_option' ) ) return; ?>
    ' .wp_kses_post( paginate_links( array( 'prev_text' => '', 'next_text' => '', 'type' => 'list' ) ) ). ''; } } add_action( 'blog_postx_pagination_link_hook', 'blog_postx_pagination_fnc' ); endif; if( ! function_exists( 'blog_postx_scroll_to_top_html' ) ) : /** * Scroll to top fnc * * @package Blog Postx Pro * @since 1.0.0 */ function blog_postx_scroll_to_top_html() { $stt_text = BPX\blog_postx_get_customizer_option( 'stt_text' ); $classes = 'blog-postx-scroll-btn align--right display--fixed'; $show_scroll_to_top_on_mobile = BPX\blog_postx_get_customizer_option( 'show_scroll_to_top_on_mobile' ); if( ! $show_scroll_to_top_on_mobile ) $classes .= ' hide-on-mobile'; ?>
    '. esc_html( $stt_text ) .''; ?>
    'div', 'show_browse' => false ); breadcrumb_trail( $breadcrumb_args ); } add_action( 'blog_postx_breadcrumb_trail_hook', 'blog_postx_breadcrumb_trail' ); endif; if( ! function_exists( 'blog_postx_breadcrumb_html' ) ) : /** * Theme breadcrumb * * @package Blog Postx Pro * @since 1.0.0 */ function blog_postx_breadcrumb_html() { $site_breadcrumb_option = BPX\blog_postx_get_customizer_option( 'site_breadcrumb_option' ); $single_post_layout = BPX\blog_postx_get_customizer_option( 'single_post_layout' ); $show_breadcrumb_on_mobile = true; $single_layout_post_meta = metadata_exists( 'post', get_the_ID(), 'single_layout' ) ? get_post_meta( get_the_ID(), 'single_layout', true ) : 'customizer-layout'; if ( ! $site_breadcrumb_option ) return; if ( is_front_page() || is_home() ) return; $site_breadcrumb_type = BPX\blog_postx_get_customizer_option( 'site_breadcrumb_type' ); $wrapperClass = 'blog-postx-breadcrumb-element'; if( ( $single_post_layout !== 'layout-six' && $single_layout_post_meta !== 'customizer-layout' ) || $single_layout_post_meta !== 'layout-six' ) $wrapperClass .= ' row'; if( ! $show_breadcrumb_on_mobile ) $wrapperClass .= ' hide-on-mobile'; ?>
    '; break; case 'svg' : echo ''; break; endswitch; } endif; if( ! function_exists( 'blog_postx_button_html' ) ) : /** * View all html * * @package Blog Postx Pro * @since 1.0.0 */ function blog_postx_button_html( $args ) { if( ! $args['show_button'] ) return; $is_after = true; $archive_read_more_text_on_mobile = true; $archive_read_more_button_on_mobile = true; $read_more_text_hide_on_mobile = ( ! $archive_read_more_text_on_mobile ) ? ' hide-on-mobile' : ''; $read_more_button_hide_on_mobile = ( ! $archive_read_more_button_on_mobile ) ? ' hide-on-mobile' : ''; $classes = isset( $args['classes'] ) ? 'blog-postx-button post-link-button' . ' ' .$args['classes'] : 'post-button blog-postx-button'; $classes .= $read_more_button_hide_on_mobile; $classes .= ' after'; $link = isset( $args['link'] ) ? $args['link'] : get_the_permalink(); $text = isset( $args['text'] ) ? $args['text'] : apply_filters( 'blog_postx_global_button_label_fitler', esc_html__( 'continue Reading..', 'blog-postx' ) ); $text_html = sprintf( '%2$s', esc_attr( $read_more_text_hide_on_mobile ), esc_html( $text ) ); $icon_html = ''; echo apply_filters( 'blog_postx_button_html', sprintf( '%3$s%4$s', esc_attr( $classes ), esc_url( $link ), wp_kses_post( $is_after ? $text_html : $icon_html ), wp_kses_post( $is_after ? $icon_html : $text_html ) ) ); } add_action( 'blog_postx_section_block_view_all_hook', 'blog_postx_button_html', 10, 1 ); endif;