'post', 'post_status' => 'publish', 'posts_per_page' => absint( $main_banner_no_of_posts_to_show ), 'order' => $post_order[1], 'order_by' => $post_order[0], 'ignore_sticky_posts' => true ]; if( isset( $main_banner_post_categories ) ) $post_query_args['cat'] = $post_categories_id_args; if( isset( $main_banner_posts_to_include ) ) $post_query_args['post__in'] = $post_to_include_id_args; if( $hide_posts_with_no_featured_image ) : $post_query_args['meta_query'] = [ [ 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ] ]; endif; $post_query = new \WP_Query( apply_filters( 'blogmatic_query_args_filter', $post_query_args ) ); if( ! $post_query->have_posts() ) return; /* Trailing Posts Variables and Query */ $main_banner_trailing_post_order = BMC\blogmatic_get_customizer_option( 'main_banner_trailing_post_order' ); $main_banner_trailing_slider_categories = BMC\blogmatic_get_customizer_option( 'main_banner_trailing_slider_categories' ); $main_banner_trailing_slider_posts_to_include = BMC\blogmatic_get_customizer_option( 'main_banner_trailing_slider_posts_to_include' ); $main_banner_trailing_no_of_posts_to_show = BMC\blogmatic_get_customizer_option( 'main_banner_trailing_no_of_posts_to_show' ); $main_banner_trailing_hide_post_with_no_featured_image = BMC\blogmatic_get_customizer_option( 'main_banner_trailing_hide_post_with_no_featured_image' ); $trailing_post_order = explode( '-', $main_banner_trailing_post_order ); $trailing_post_categories_id_args = ( ! empty( $main_banner_trailing_slider_categories ) ) ? implode( ",", array_column( $main_banner_trailing_slider_categories, 'value' ) ) : ''; $trailing_post_to_include_id_args = ( ! empty( $main_banner_trailing_slider_posts_to_include ) ) ? array_column( $main_banner_trailing_slider_posts_to_include, 'value' ) : ''; $trailing_post_query_args = [ 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => absint( $main_banner_trailing_no_of_posts_to_show ), 'order' => $trailing_post_order[1], 'order_by' => $trailing_post_order[0], 'ignore_sticky_posts' => true ]; if( isset( $main_banner_trailing_slider_categories ) ) $trailing_post_query_args['cat'] = $trailing_post_categories_id_args; if( isset( $main_banner_trailing_slider_posts_to_include ) ) $trailing_post_query_args['post__in'] = $trailing_post_to_include_id_args; if( $main_banner_trailing_hide_post_with_no_featured_image ) : $trailing_post_query_args['meta_query'] = [ [ 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ] ]; endif; $trailing_post_query = new \WP_Query( apply_filters( 'blogmatic_query_args_filter', $trailing_post_query_args ) ); ?>
have_posts() ) : $post_query->the_post(); $thumbnails[] = get_the_post_thumbnail_url(); ?>
', '' ); echo '
'. esc_html( wp_trim_words( get_the_excerpt(), 15 ) ) .'
'; echo ''; ?>
0 ): ?>
have_posts() ) : while( $post_query->have_posts() ) : $post_query->the_post(); echo '
'; the_post_thumbnail( 'post-thumbnail' ); echo '
'; endwhile; endif; ?>
have_posts() ) : $count = 1; while( $trailing_post_query->have_posts() ) : $trailing_post_query->the_post(); ?>
', '' ); blogmatic_posted_on( get_the_ID(), 'banner' ); ?>
$type .'_slider_prev_arrow', 'next' => $type .'_slider_next_arrow' ]; foreach( $pagination_array as $pagination_key => $pagination ) : $paginationClass = 'custom-button-' . $pagination_key; $paginationClass .= ' swiper-arrow'; ?>
'; else: echo ''; endif; ?>
'post', 'post_status' => 'publish', 'posts_per_page' => absint( $carousel_no_of_posts_to_show ), 'order' => $post_order[1], 'order_by' => $post_order[0], 'ignore_sticky_posts' => true ]; if( isset( $carousel_post_categories ) ) $post_query_args['cat'] = $post_categories_id_args; if( isset( $carousel_posts_to_include ) ) $post_query_args['post__in'] = $post_to_include_id_args; if( $hide_posts_with_no_featured_image ) : $post_query_args['meta_query'] = [ [ 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ] ]; endif; $post_query = new \WP_Query( apply_filters( 'blogmatic_query_args_filter', $post_query_args ) ); if( ! $post_query->have_posts() ) return; ?> '; break; default: $output = ''; } return $output; } endif; if( ! function_exists( 'blogmatic_convert_number_to_numeric_string' )) : /** * Function to convert int parameter to numeric string * MARK: CONVERT NUMBER TO STRING * * @return string */ function blogmatic_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( 'blogmatic_post_read_time' ) ) : /** * Function derives the read time * @return float */ function blogmatic_post_read_time( $string = '' ) { $read_time = 0; if( empty( $string ) ) { return 0 . esc_html__( ' min', 'blogmatic' ); } else { $read_time = apply_filters( 'blogmatic_content_read_time', round( str_word_count( wp_strip_all_tags( $string ) ) / 100 ), 2 ); if( $read_time == 0 ) { return 1 . esc_html__( ' min', 'blogmatic' ); } else { return $read_time . esc_html__( ' mins', 'blogmatic' ); } } } endif; if( ! function_exists( 'blogmatic_get_post_categories' ) ) : /** * Function contains post categories html * @return float */ function blogmatic_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; echo ''; } endif; if( ! function_exists( 'blogmatic_loader_html' ) ) : /** * Preloader html * MARK: PRELOADER * * @package Blogmatic * @since 1.0.0 */ function blogmatic_loader_html() { if( ! BMC\blogmatic_get_customizer_option( 'preloader_option' ) ) return; $elementClass = 'blogmatic_loading_box'; $elementClass .= ' preloader-style--two'; ?>
' .wp_kses_post( paginate_links( array( 'prev_text' => '', 'next_text' => '', 'type' => 'list' ) ) ). ''; } } add_action( 'blogmatic_pagination_link_hook', 'blogmatic_pagination_fnc' ); endif; if( ! function_exists( 'blogmatic_scroll_to_top_html' ) ) : /** * Scroll to top fnc * MARK: SCROLL TO TOP * * @package Blogmatic * @since 1.0.0 */ function blogmatic_scroll_to_top_html() { $stt_text = BMC\blogmatic_get_customizer_option( 'stt_text' ); $stt_icon = BMC\blogmatic_get_customizer_option( 'stt_icon' ); $classes = 'blogmatic-scroll-btn'; $classes .= ' align--right'; $classes .= ' display--fixed'; $show_scroll_to_top_on_mobile = BMC\blogmatic_get_customizer_option( 'show_scroll_to_top_on_mobile' ); if( ! $show_scroll_to_top_on_mobile ) $classes .= ' hide-on-mobile'; ?>
'. esc_html( $stt_text ) .''; ?>
'; endif; } else { if( $stt_icon['type'] != 'none' )echo ''. wp_get_attachment_image( $stt_icon['value'], 'full' ) .''; } ?>
'div', 'show_browse' => false ); breadcrumb_trail( $breadcrumb_args ); } add_action( 'blogmatic_breadcrumb_trail_hook', 'blogmatic_breadcrumb_trail' ); endif; if( ! function_exists( 'blogmatic_breadcrumb_html' ) ) : /** * Theme breadcrumb * MARK: BREADCRUMB * * @package Blogmatic * @since 1.0.0 */ function blogmatic_breadcrumb_html() { $site_breadcrumb_option = BMC\blogmatic_get_customizer_option( 'site_breadcrumb_option' ); $single_post_layout = BMC\blogmatic_get_customizer_option( 'single_post_layout' ); $show_breadcrumb_on_mobile = BMC\blogmatic_get_customizer_option( 'show_breadcrumb_on_mobile' ); $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 = BMC\blogmatic_get_customizer_option( 'site_breadcrumb_type' ); $wrapperClass = 'blogmatic-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( 'blogmatic_category_collection_html' ) ) : /** * Category Collection html part * MARK: CATEGORY COLLECTION * * @since 1.0.0 * @package Blogmatic */ function blogmatic_category_collection_html() { $category_collection_render_in = BMC\blogmatic_get_customizer_option( 'category_collection_render_in' ); $category_collection_option = BMC\blogmatic_get_customizer_option( 'category_collection_option' ); if( ! $category_collection_option || is_paged() ) : return; elseif( $category_collection_render_in == 'front_page' && ! is_front_page() ) : return; elseif( $category_collection_render_in == 'posts_page' && ! is_home() ) : return; elseif( $category_collection_render_in == 'both' && ( ! is_front_page() && ! is_home() ) ): return; endif; if( ! $category_collection_option ) return; $category_collection_layout = BMC\blogmatic_get_customizer_option( 'category_collection_layout' ); $category_collection_number_of_columns = BMC\blogmatic_get_customizer_option( 'category_collection_number_of_columns' ); $category_to_include = BMC\blogmatic_get_customizer_option( 'category_to_include' ); $category_to_exclude = BMC\blogmatic_get_customizer_option( 'category_to_exclude' ); $category_collection_number = BMC\blogmatic_get_customizer_option( 'category_collection_number' ); $category_collection_orderby = BMC\blogmatic_get_customizer_option( 'category_collection_orderby' ); $category_collection_sort = explode( '-', $category_collection_orderby ); $category_collection_image_size = BMC\blogmatic_get_customizer_option( 'category_collection_image_size' ); $category_collection_hover_effects = BMC\blogmatic_get_customizer_option( 'category_collection_hover_effects' ); $sectionClass = 'blogmatic-category-collection-section'; $catCollectionWrapperClass = 'category-collection-wrap'; $catItemClass = 'category-wrap'; $sectionClass .= ' layout--' . $category_collection_layout; $sectionClass .= ' hover-effect--' . $category_collection_hover_effects; $sectionClass .= ' column--' . blogmatic_convert_number_to_numeric_string( absint( $category_collection_number_of_columns['desktop'] ) ); $sectionClass .= ' tab-column--' . blogmatic_convert_number_to_numeric_string( absint( $category_collection_number_of_columns['tablet'] ) ); $sectionClass .= ' mobile-column--' . blogmatic_convert_number_to_numeric_string( absint( $category_collection_number_of_columns['smartphone'] ) ); $category_args = [ 'number' => absint( $category_collection_number ), 'exclude' => ( ! empty( $category_to_exclude ) ) ? array_column( $category_to_exclude, 'value' ) : [], 'include' => ( ! empty( $category_to_include ) ) ? array_column( $category_to_include, 'value' ) : [], 'orderby' => $category_collection_sort[1], 'order' => $category_collection_sort[0] ]; $get_all_categories = get_categories( $category_args ); ?>
$cat_value ) : $category_query_args = [ 'cat' => absint( $cat_value->term_id ), 'meta_query' => [ [ 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ] ], 'ignore_stick_posts' => true ]; $category_query = new WP_Query( apply_filters( 'blogmatic_query_args_filter', $category_query_args ) ); if( $category_query->have_posts() ) : $thumbnail_id = ( $category_query->posts[0]->ID != null ) ? $category_query->posts[0]->ID : ''; else: $thumbnail_id = ''; endif; ?>
%1$s', esc_html( $text ) ); $icon_html = ( $icon != '' ) ? sprintf( '', esc_attr( $icon ) ) : ''; echo apply_filters( 'blogmatic_button_html', sprintf( '%3$s%4$s', esc_attr( $classes ), esc_url( $link ), wp_kses_post( $text_html ), wp_kses_post( $icon_html ) ) ); } add_action( 'blogmatic_section_block_view_all_hook', 'blogmatic_button_html', 10, 1 ); endif;