' . esc_html( $education_master_block_title ) . ''; } else { echo '

' . esc_html( $education_master_block_title ) . '

'; } } endif; /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Block Default Layout * * @since 1.0.0 */ if ( ! function_exists( 'education_master_block_default_layout_section' ) ) : function education_master_block_default_layout_section( $cat_id ) { if ( empty( $cat_id ) ) { return; } $education_master_post_count = apply_filters( 'education_master_block_default_posts_count', 6 ); $block_args = array( 'cat' => $cat_id, 'posts_per_page' => absint( $education_master_post_count ), ); $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( 'education_master_block_second_layout_section' ) ) : function education_master_block_second_layout_section( $cat_id ) { if ( empty( $cat_id ) ) { return; } $education_master_post_count = apply_filters( 'education_master_block_second_layout_posts_count', 6 ); $block_args = array( 'cat' => $cat_id, 'posts_per_page' => absint( $education_master_post_count ), ); $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( 'education_master_block_box_layout_section' ) ) : function education_master_block_box_layout_section( $cat_id ) { if ( empty( $cat_id ) ) { return; } $education_master_post_count = apply_filters( 'education_master_block_box_posts_count', 4 ); $block_args = array( 'cat' => $cat_id, 'posts_per_page' => absint( $education_master_post_count ), ); $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( 'education_master_block_alternate_grid_section' ) ) : function education_master_block_alternate_grid_section( $cat_id ) { if ( empty( $cat_id ) ) { return; } $education_master_post_count = apply_filters( 'education_master_block_alternate_grid_posts_count', 3 ); $block_args = array( 'cat' => $cat_id, 'posts_per_page' => absint( $education_master_post_count ), ); $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 '
    '; while ( $education_master_block_query->have_posts() ) { $education_master_block_query->the_post(); if ( $education_master_style === 'layout1' ) { ?> '; } wp_reset_postdata(); } endif;