'; // echo '
'; // echo '
' , ( $lang == 'ru' ) ? 'Ваш браузер устарел!' : 'Your browser is out of date!' , '
'; // echo '

' , ( $lang == 'ru' ) ? 'Обновите ваш браузер для правильного отображения этого сайта.' : 'Update your browser to view this website correctly.' , '

'; // echo '' , ( $lang == 'ru' ) ? 'Обновить браузер' : 'Update browser' , ''; // echo '
'; // echo ''; // } // add_action('wp_body_open', 'outdatedbrowser_after_body_open_tag'); // } // } // Check if the current user is an administrator if ( ! function_exists( 'isSiteAdmin' ) ) { function isSiteAdmin() { return in_array( 'administrator', wp_get_current_user()->roles ); } } // Register menu register_nav_menus( array( 'top' => 'Top', )); /** * Disable the generation of additional images */ add_filter( 'intermediate_image_sizes', 'dco_remove_default_image_sizes' ); add_action( 'init', 'remove_all_image_sizes' ); if ( ! function_exists( 'dco_remove_default_image_sizes' ) ) { function dco_remove_default_image_sizes( $sizes ) { return array_diff( $sizes, array( 'thumbnail', 'medium', 'medium_large', 'large', ) ); } } if ( ! function_exists( 'remove_all_image_sizes' ) ) { function remove_all_image_sizes() { foreach( get_intermediate_image_sizes() as $size ) { remove_image_size( $size ); } } } // Add logo to wp-admin page if ( ! function_exists( 'wp_admin_logo' ) ) { function wp_admin_logo() { ?> 350, // Макс. количество символов. 'text' => '', // Какой текст обрезать (по умолчанию post_excerpt, если нет post_content. // Если в тексте есть ``, то `maxchar` игнорируется и берется // все до вместе с HTML. 'autop' => true, // Заменить переносы строк на

и
или нет? 'save_tags' => '', // Теги, которые нужно оставить в тексте, например ''. 'more_text' => 'Читать дальше...', // Текст ссылки `Читать дальше`. 'ignore_more' => false, // нужно ли игнорировать в контенте ), $args ); $rg = apply_filters( 'kama_excerpt_args', $rg ); if( ! $rg->text ) $rg->text = $post->post_excerpt ?: $post->post_content; $text = $rg->text; // убираем блочные шорткоды: [foo]some data[/foo]. Учитывает markdown $text = preg_replace( '~\[([a-z0-9_-]+)[^\]]*\](?!\().*?\[/\1\]~is', '', $text ); // убираем шоткоды: [singlepic id=3]. Учитывает markdown $text = preg_replace( '~\[/?[^\]]*\](?!\()~', '', $text ); $text = trim( $text ); // if( ! $rg->ignore_more && strpos( $text, '') ){ preg_match('/(.*)/s', $text, $mm ); $text = trim( $mm[1] ); $text_append = ' '. $rg->more_text .''; } // text, excerpt, content else { $text = trim( strip_tags($text, $rg->save_tags) ); // Обрезаем if( mb_strlen($text) > $rg->maxchar ){ $text = mb_substr( $text, 0, $rg->maxchar ); $text = preg_replace( '~(.*)\s[^\s]*$~s', '\\1...', $text ); // кил последнее слово, оно 99% неполное } } // сохраняем переносы строк. Упрощенный аналог wpautop() if( $rg->autop ){ $text = preg_replace( array("/\r/", "/\n{2,}/", "/\n/", '~


~'), array('', '

', '
', '

'), $text ); } $text = apply_filters( 'kama_excerpt', $text, $rg ); if( isset($text_append) ) $text .= $text_append; return ( $rg->autop && $text ) ? "

$text

" : $text; } function posts_shortcode_function( $attrs ) { ob_start(); $attrs = shortcode_atts( [ 'cat_id' => '', 'posts_per_page' => '5', ], $attrs ); $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = [ 'paged' => $paged, 'cat' => $attrs[ 'cat_id' ], 'post_status' => 'publish', 'posts_per_page' => $attrs[ 'posts_per_page' ], ]; $query = new WP_Query( $args ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); $category = get_the_category(); if( $category[0]->cat_name == 'Research' ) { ?>

Listen to the show