'; $title_other_html .= ''; $title_other_html .= ''; $title_other_html .= ''; $title_other_html .= ''; $title_other_html .= ''; $title_other_html .= ''; $title_other_html .= ''; } if($title_other_html){ $replace_tag = ''; if(stripos( $after_title, $replace_tag ) !== false ){ $after_title = str_replace( $replace_tag, $title_other_html.$replace_tag, $after_title ); }else{ $replace_tag = ''; $after_title = str_replace( $replace_tag, $title_other_html.$replace_tag, $after_title ); } } echo $after_title; } } endif; add_action( 'blogmagazine_widget_title', 'blogmagazine_widget_title_callback' ); /** * Block Default Layout * * @since 1.0.0 */ if( ! function_exists( 'blogmagazine_block_default_layout_section' ) ) : function blogmagazine_block_default_layout_section( $blogmagazine_args ) { $terms_ids = $blogmagazine_args['terms_ids']; $thumbnail_size = $blogmagazine_args['thumbnail_size']; $largeimg_size = $blogmagazine_args['largeimg_size']; $excerpt_length = $blogmagazine_args['excerpt_length']; $posts_page_page = 6; $block_args = array( 'post_type' => 'post', 'posts_per_page' => absint( $posts_page_page ), ); if( ! empty( $terms_ids ) ) { $block_args['tax_query'] = array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $terms_ids, 'operator' => 'IN', ), ); } $block_query = new WP_Query( $block_args ); $total_posts_count = $block_query->post_count; if( $block_query->have_posts() ) { $post_count = 1; while( $block_query->have_posts() ) { $block_query->the_post(); if( $post_count == 1 ){ echo '
'; $title_size = 'large-size'; } elseif( $post_count == 2 ) { echo '
'; $title_size = 'small-size'; } else { $title_size = 'small-size'; } ?>

'; } elseif( $post_count == $total_posts_count ) { echo '
'; } $post_count++; } } wp_reset_postdata(); } endif; /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Block Second Layout * * @since 1.0.0 */ if( ! function_exists( 'blogmagazine_block_second_layout_section' ) ) : function blogmagazine_block_second_layout_section( $blogmagazine_args ) { $terms_ids = $blogmagazine_args['terms_ids']; $thumbnail_size = $blogmagazine_args['thumbnail_size']; $largeimg_size = $blogmagazine_args['largeimg_size']; $excerpt_length = $blogmagazine_args['excerpt_length']; $posts_page_page = 6; $block_args = array( 'post_type' => 'post', 'posts_per_page' => absint( $posts_page_page ), ); if( ! empty( $terms_ids ) ) { $block_args['tax_query'] = array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $terms_ids, 'operator' => 'IN', ), ); } $block_query = new WP_Query( $block_args ); $total_posts_count = $block_query->post_count; if( $block_query->have_posts() ) { $post_count = 1; while( $block_query->have_posts() ) { $block_query->the_post(); if( $post_count == 1 ) { echo '
'; } elseif( $post_count == 3 ) { echo '
'; } if( $post_count <= 2 ) { $title_size = 'large-size'; } else { $title_size = 'small-size'; } ?>

'; } elseif( $post_count == $total_posts_count ) { echo '
'; } $post_count++; } } wp_reset_postdata(); } endif; /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Block Box Layout * * @since 1.0.0 */ if( ! function_exists( 'blogmagazine_block_box_layout_section' ) ) : function blogmagazine_block_box_layout_section( $terms_ids ) { if( empty( $terms_ids ) ) { return; } $posts_page_page = apply_filters( 'blogmagazine_block_box_posts_count', 4 ); $block_args = array( 'cat' => $terms_ids, 'posts_per_page' => absint( $posts_page_page ), ); $block_query = new WP_Query( $block_args ); $total_posts_count = $block_query->post_count; if( $block_query->have_posts() ) { $post_count = 1; while( $block_query->have_posts() ) { $block_query->the_post(); if( $post_count == 1 ) { echo '
'; $title_size = 'large-size'; } elseif( $post_count == 2 ) { echo '
'; $title_size = 'small-size'; } else { $title_size = 'small-size'; } ?>

'; } elseif( $post_count == $total_posts_count ) { echo '
'; } $post_count++; } } wp_reset_postdata(); } endif; /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Block alternate grid * * @since 1.0.0 */ if( ! function_exists( 'blogmagazine_block_alternate_grid_section' ) ) : function blogmagazine_block_alternate_grid_section( $terms_ids ) { if( empty( $terms_ids ) ) { return; } $posts_page_page = apply_filters( 'blogmagazine_block_alternate_grid_posts_count', 3 ); $block_args = array( 'cat' => $terms_ids, 'posts_per_page' => absint( $posts_page_page ), ); $block_query = new WP_Query( $block_args ); $total_posts_count = $block_query->post_count; if( $block_query->have_posts() ) { while( $block_query->have_posts() ) { $block_query->the_post(); ?>

have_posts() ) { echo '