'teacher', 'posts_per_page' => -1, 'post_status' => 'publish', ); if ( ! empty( $teacher_ids ) ) { $query_args['post__in'] = $teacher_ids; $query_args['orderby'] = 'post__in'; } else { $query_args['orderby'] = 'date'; $query_args['order'] = 'DESC'; } $teachers_query = new WP_Query( $query_args ); ?>
Преподаватели

Наши преподаватели — практикующие педагоги

have_posts() ) : ?> have_posts() ) : $teachers_query->the_post(); $t_id = get_the_ID(); $t_name = get_the_title(); $t_subj = get_post_meta( $t_id, '_teacher_direction', true ); $t_about = get_post_meta( $t_id, '_teacher_description', true ); $t_badge = get_post_meta( $t_id, '_teacher_badge', true ); $t_photo = get_post_meta( $t_id, '_teacher_avatar', true ); $start_year = get_post_meta( $t_id, '_teacher_start_year', true ); // Experience calculation. $t_exp = ''; if ( $start_year && is_numeric( $start_year ) ) { $e = (int) date( 'Y' ) - (int) $start_year; if ( $e > 0 ) { $t_exp = $e . ' лет'; } } // Name splitting: first part on first line, rest on second. $name_parts = explode( ' ', $t_name, 2 ); $name_first = $name_parts[0] ?? $t_name; $name_rest = $name_parts[1] ?? ''; // Description truncation. $t_about_clean = $t_about ? wp_strip_all_tags( $t_about ) : ''; if ( mb_strlen( $t_about_clean ) > 200 ) { $t_about_clean = mb_substr( $t_about_clean, 0, 200 ) . '…'; } ?>
<?php echo esc_attr( $t_name ); ?> <?php echo esc_attr( $t_name ); ?>


Стаж: