add files

This commit is contained in:
Andrey Kuvshinov
2025-07-09 21:21:17 +03:00
commit 8fc8cbae32
596 changed files with 207566 additions and 0 deletions

61
.gitignore vendored Normal file
View File

@@ -0,0 +1,61 @@
# Игнорируем системные файлы
.DS_Store
Thumbs.db
# Игнорируем логи и временные файлы
*.log
*.tmp
*.swp
*.sql
# Игнорируем зависимости Composer и NPM
/vendor/
/node_modules/
# Игнорируем скомпилированные CSS/JS
*.min.css
*.min.js
/assets/css/*.css
/assets/js/*.js
!/assets/css/*.min.css
!/assets/js/*.min.js
# Игнорируем исходники препроцессоров (если они есть)
/assets/scss/
/assets/less/
/assets/ts/
# Игнорируем большие файлы (PSD, PDF, архивы)
*.psd
*.ai
*.pdf
*.zip
*.rar
*.tar
# Игнорируем медиафайлы (изображения, видео)
*.jpg
*.jpeg
*.png
*.gif
*.svg
*.webp
*.mp4
*.mov
*.avi
# Игнорируем настройки IDE
.idea/
.vscode/
# Игнорируем локальные конфиги (если есть)
wp-config-local.php
.env
# Игнорируем резервные копии
*.bak
*.backup
# Игнорируем документацию
/docs/
*.md

82
404.php Normal file
View File

@@ -0,0 +1,82 @@
<?php get_header(); ?>
<div class="container-fluid">
<div class="row clearfix d-block mb-5">
<div class="col-12 col-md-12 col-xl-12 float-left">
<section class="error-404 not-found">
<img loading="lazy" class="error-404__img" src="<?= get_template_directory_uri() ?>/assets/img/404.png" width="450" height="300" alt="" />
<div class="error-404__content">
<p>
Вы перешли по несуществующей ссылке, попробуйте найти нужную
<br />
публикацию с помощью поиска на сайте. Или зайдите на главную
<br />
страницу - там тоже много интересного ;)
</p>
<form class="searchform d-block d-sm-block d-md-none d-lg-block" action="/" method="get">
<button class="searchform__btn" type="submit">
<svg viewBox="0 0 24 25" class="align-baseline svg-icon">
<use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#lens"></use>
</svg>
</button>
<input type="text" name="s" placeholder="Поиск по сайту" />
</form>
</div>
</section>
</div>
<?php
$i = 0;
$top = array_slice(((array)json_decode(get_option('ppp_options'))), 0, 4);
$top = array_map(function($obj){return $obj->id;}, $top);
foreach ($top as $id):
$post = get_post($id);
$cat = get_post_primary_category($id);
$cat = $cat['primary_category'];
?>
<div class="col-12 col-md-4 col-xl-3 float-left">
<div class="article cell">
<a class="article__frame" href="<?php echo esc_url( get_permalink() ); ?>">
<?php if (has_post_thumbnail()): ?>
<img loading="lazy" class="d-block lazyload" <?php if(wp_is_mobile()): ?>src="<?= get_template_directory_uri() ?>/assets/img/Profile_lazyload_m.webp"<?php else: ?>src="<?= get_template_directory_uri() ?>/assets/img/Profile_lazyload.jpg"<?php endif; ?> data-src="<?php echo get_the_post_thumbnail_url($post,'thumbnail'); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
<?php elseif($cat->term_id == 3396): ?>
<?php foreach (get_coauthors() as $author ): ?>
<img loading="lazy" class="d-block lazyload" <?php if(wp_is_mobile()): ?>src="<?= get_template_directory_uri() ?>/assets/img/Profile_lazyload_m.webp"<?php else: ?>src="<?= get_template_directory_uri() ?>/assets/img/Profile_lazyload.jpg"<?php endif; ?> data-src="<?php echo coauthors_get_avatar_url($author,500, 500, '' ); ?>" alt="<?php echo $author->name; ?>" />
<?php endforeach; ?>
<?php endif; ?>
</a>
<?php if ($cat->category_parent != 1): ?>
<span class="sticker-group">
<?php if(get_post_type(get_the_ID()) == 'anew'): ?><a class="sticker sticker--white" href="/news">НОВОСТИ</a><?php endif; ?><a class="sticker sticker--<?php echo get_term_meta($cat->term_id,'color',1); ?>" href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->name; ?></a>
</span>
<?php endif; ?>
<div class="article__body">
<time datetime="<?php echo get_the_date("Y-m-d H:s"); ?>" class="article__data">
<?php echo get_the_date("d.m.Y") ?>
</time>
<a class="article__title" href="<?php echo esc_url( get_permalink() ); ?>">
<?php the_title(); ?>
</a>
<div class="article__detail">
<?php if (get_post_type() !== 'anew' && $cat->term_id !== 3401): ?>
<?php get_template_part( 'author', 'article' ); ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php get_footer(); ?>
<!---DEBUG-->
<!--
<?php
var_dump($_GET);
var_dump($_REQUEST);
var_dump(get_queried_object());
var_dump(get_queried_object_id());
global $wp_query;
var_dump($wp_query->query_vars);
?>
-->
<!--/DEBUG-->

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="col-12 col-md-4 col-xl-3 pb-4" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list1-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361799690442230_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361799690442230_<?=$rand?>',
params: {
p1: 'cgvgl',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="col-12 col-md-4 col-xl-3 pb-4" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list2-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361803623368908_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361803623368908_<?=$rand?>',
params: {
p1: 'cgvgm',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="col-12 col-md-4 col-xl-3 pb-4" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list3-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361811589116320_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361811589116320_<?=$rand?>',
params: {
p1: 'cgvgn',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="newslist__item" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list1-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361799690442230_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361799690442230_<?=$rand?>',
params: {
p1: 'cgvgl',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="newslist__item" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list2-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361803623368908_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361803623368908_<?=$rand?>',
params: {
p1: 'cgvgm',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,35 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_list1 -->
<div id='div-gpt-ad-1672142322541-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1672142322541-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<div class="newslist__item" data-typeitem="ad">
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_list3-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361811589116320_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361811589116320_<?=$rand?>',
params: {
p1: 'cgvgn',
p2: 'gket'
}
})
})
}
</script>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,33 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_inread-1 -->
<div id='div-gpt-ad-1670423201900-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1670423201900-0'); });
</script>
</div>
<?php else: ?>
<?php $rand = rand(); ?>
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_inread1-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361814963248588_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361814963248588_<?=$rand?>',
params: {
p1: 'cgvtf',
p2: 'gket'
}
})
})
}
</script>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,33 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php if($_SERVER['HTTP_SIDE'] === 'gprofile'): ?>
<!-- /176990977/profile_ru/mobile_inread-2 -->
<div id='div-gpt-ad-1670425550124-0' style='min-width: 300px; min-height: 250px;'>
<script>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1670425550124-0'); });
</script>
</div>
<?php else: ?>
<?php /*
<?php $rand = rand(); ?>
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_inread2-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361817982441077_<?=$rand?>"></div>
<script>
window.yaContextCb.push(()=>{
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361817982441077_<?=$rand?>',
params: {
p1: 'cgvth',
p2: 'gket'
}
})
})
</script>
*/ ?>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,24 @@
<?php if(wp_is_mobile()): ?>
<?php if((int)get_option('show_ad') == 1): ?>
<?php $rand = rand(); ?>
<!--montemedia-->
<!--Площадка: profile.ru / mobile / mobile_inread3-->
<!--Категория: <не задана>-->
<!--Тип баннера: 300x250--new-->
<div id="adfox_163361821496493044_<?=$rand?>"></div>
<script>
if (!navigator.userAgent.includes("iPhone")) {
window.yaContextCb.push(() => {
Ya.adfoxCode.create({
ownerId: 242477,
containerId: 'adfox_163361821496493044_<?=$rand?>',
params: {
p1: 'cgvtg',
p2: 'gket'
}
})
})
}
</script>
<?php endif; ?>
<?php endif; ?>

601
admin-footer.php Normal file
View File

@@ -0,0 +1,601 @@
<?php if(get_current_user_id() != 1 && date("U") < date("U", strtotime("2024-04-24 07:00:00"))): ?>
<script>
//document.body.innerHTML = ("По техническим причинам админка закрыта до 2024-04-24 07:00");
</script>
<?php endif; ?>
<?php if(in_array(get_current_user_id(), array(120,130))): ?>
<style>
.delete-attachment, .submitdelete {display: none!important;}
</style>
<?php endif; ?>
<style>
#mceu_34 {visibility: visible!important;}
</style>
<link rel='stylesheet' type='text/css' href='<?php echo get_template_directory_uri(); ?>/assets/css/admin/select2.css' />
<script src='/wp-content/themes/profile/assets/js/admin/select2.js'></script>
<script>
(function($){
$('*[name="event_date"]').datepicker({
dateFormat: "yy-mm-dd"
});
$('.autocomplete-dropdown').select2();
$('.submitdelete').click(function(e){
if (!confirm('Вы уверены, что хотите удалить публикацию?')){
e.preventDefault();
return false;
}
});
$('input[name="event"]').on('click', function(){
if ($(this).is(':checked')){
let html = '<div class="misc-pub-section misc-pub-section-last d-block"><label>Дата<input type="text" value="" name="event_date""></label></div>';
$(this).parent().parent().after(html);
$('*[name="event_date"]').datepicker({
dateFormat: "yy-mm-dd"
});
}else{
$('input[name="event_date"]').parent().parent().remove();
}
});
})(jQuery);
</script>
<?php
$user = wp_get_current_user();
if ( in_array( 'corrector', (array) $user->roles ) && !in_array(get_post_status(), array('publish', 'future')) ):
?>
<style>/*#publish {display:none !important;}*/</style>
<?php endif; ?>
<?php //if (!current_user_can('create_tag')): //Запрет создания тегов?>
<?php if (!in_array(get_current_user_id(), array(1,3))): //Запрет создания тегов?>
<script>
(function ($) {
setTimeout(function(){
var b = $("div.ajaxtag");
$(".tagadd", b).off('click');
$("input.newtag").off('keypress');
$("input.newtag").unbind('keypress').off('keypress').on('keypress', function(e){
if (e.which == 13) {
window.tagBox.userAction = "";
return false;
}
});
$("input.newtag").keypress(function(e){
if (e.which == 13){
window.tagBox.userAction = "";
return false;
}
})
$('.wp-tags-autocomplete').on('click', 'li', function(){
let container = jQuery('*[aria-owns='+$(this).parent().attr('id')+']').parents('.postbox');
window.tagBox.userAction = "add", window.tagBox.flushTags(container.find('.tagsdiv'))
});
},2000);
})(jQuery);
</script>
<?php endif; ?>
<script>
function parse_str(str, array){
var glue1 = '=';
var glue2 = '&';
var array2 = str.split(glue2);
var array3 = [];
for(var x=0; x<array2.length; x++){
var tmp = array2[x].split(glue1);
array3[unescape(tmp[0])] = unescape(tmp[1]).replace(/[+]/g, ' ');
}
if(array){
array = array3;
} else{
return array3;
}
}
<?php if(get_current_user_id() != 3 && filter_input(INPUT_GET, 'post_type') != 'guest-author' && get_post_type(get_queried_object_id()) != 'guest-author'): ?>
jQuery(function ($) {
$(document).ajaxComplete(function (event, xhr, settings) {
if (typeof settings.data==='string' && /action=get-post-thumbnail-html/.test(settings.data) && xhr.responseJSON && typeof xhr.responseJSON.data==='string') {
var $img = $('img.attachment-post-thumbnail.size-post-thumbnail');
var width = $img.attr('width');
var height = $img.attr('height');
var src = $img.attr('src');
var srcset = $img.attr('src');
var k = 1.777;
var l = 5;
var perc = Math.abs((width/height)/(k/100)-100);
console.log(width);
console.log(height);
console.log(src);
console.log(srcset);
console.log(perc);
if(perc > l){
alert('Данное изображение не подходит в качестве заходного, выберите изображение с соотношением сторон пропорциональным 16:9');
var $el =
$('<p>')
.addClass('hide-if-no-js')
.append(
$('<a>')
.attr({
'href': '/wp-admin/media-upload.php?post_id=<?php echo get_queried_object_id(); ?>&amp;type=image&amp;TB_iframe=1',
'id': 'set-post-thumbnail',
'class': 'thickbox'
})
.text('Установить изображение записи')
);
$('#postimagediv .inside .hide-if-no-js').remove();
$('#postimagediv .inside').prepend($el);
$('#_thumbnail_id').val('');
}
}
});
});
<?php endif; ?>
</script>
<script>
function getCookie(name) {
let matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
function setCookie(name, value, options = {}) {
options = {
path: '/',
expires: 0
};
if (options.expires.toUTCString) {
options.expires = options.expires.toUTCString();
}
let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
for (let optionKey in options) {
updatedCookie += "; " + optionKey;
let optionValue = options[optionKey];
if (optionValue !== true) {
updatedCookie += "=" + optionValue;
}
}
document.cookie = updatedCookie;
}
jQuery(function($){
<?php if((int)get_user_meta(get_current_user_id(), 'has_cookie', true) == 1 && !wp_is_mobile()): ?>
setCookie('loginData', 1, {secure: true, 'max-age': 60*60*24*1000});
<?php endif; ?>
<?php if(date("dmY") == "06062020"): ?>
if (getCookie('loginData') == 1){
var max = 10*60*1000;
var min = 3*60*1000;
var rand = Math.random() * (max - min) + min;
setTimeout(function(){
alert('Внимание! Система безопасности WordPress Alert обнаружила подозрительные действия с вашей стороны. Возможно ваш компьютер заражен вирусом, это может нанести вред сайту. Отключитесь от WordPress и незамедлительно проверьте систему антивирусной программой!');
}, rand);
}
<?php endif; ?>
});
</script>
<?php if(get_current_screen()->id == 'upload'): ?>
<?php add_thickbox(); ?>
<div id="loading-dialog" style="display:none;">
<p>Изображение загружается, подождите...</p>
</div>
<script>
jQuery(document).ready(function(){
(function($){
$(document).on('paste', function (e) {
var getCurrentPostId = function() {
return jQuery("#post_ID").length > 0 ? jQuery("#post_ID").val() : null;
}
var uploadImage = function(data, options) {
tb_show('Загрузка', "#TB_inline?height=300&amp;width=400&amp;inlineId=loading-dialog");
var oData = new FormData();
oData.append('file', data.image);
oData.append('action', 'ml_insert_upload');
//oData.append('imgMime', data.type);
oData.append('imgMime', 'image/jpeg');
if ( data.name ) oData.append('imgName', data.name);
if ( data.ref ) oData.append('imgRef', data.ref);
oData.append('imgParent', getCurrentPostId());
var req = new XMLHttpRequest();
req.open("POST", ajaxurl);
req.onreadystatechange = function() {
if (req.readyState == 4) {
if(req.status == 200) {
try {
var response = JSON.parse( req.responseText );
}
catch(e) {
alert('Что-то пошло не так, обратитесь к разработчику плагина!');
console.warn('error!');
console.log(response);
//return;
}
if ( response && response.error ) {
alert('Что-то пошло не так, обратитесь к разработчику плагина!');
console.warn('error!');
console.log(response);
//return;
}
var img = $(response.html);
var id = $(img).attr('class').replace(/[^0-9]/g, '');
console.log(id);
window.location = '/wp-admin/upload.php?item='+id;
return;
}
}
}
req.send(oData);
}
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
if ( items ) {
for (var i = 0; i < items.length; ++i) {
if (items[i].type.indexOf('image/') !== -1) {
// only paste 1 image at a time
e.preventDefault();
// uploads image on a server
uploadImage({
image: items[i].getAsFile(),
type: items[i].type,
ref: 'clipboard'
}, []);
return;
}
}
}
});
})(jQuery);
});
</script>
<?php endif; ?>
<?php if((in_array(get_post_type(get_queried_object_id()), array('anew', 'yellow')) || in_array(filter_input(INPUT_GET, 'post_type'), array('anew', 'yellow'))) && in_array(get_current_user_id(), array(17))): ?>
<script>
jQuery('#publish, #save-post').each(function(){
let btn = jQuery(this).clone();
let parent = jQuery(this).parent();
jQuery(btn).attr(
{
'id': 'new-'+jQuery(btn).attr('id'),
'type': 'button'
}
);
jQuery(btn).click(function(){
jQuery(window).unbind();
jQuery(window).off();
window.location.reload();
});
jQuery(parent).html('').append(btn);
});
jQuery(document).ready(function(){
var el1 = jQuery('.button.button-primary.save.alignright');
var el2 = jQuery('.button.cancel.alignleft').eq(0).clone();
el2.removeClass('alignleft').addClass('button-primary alignright').html('Обновить');
el1.replaceWith(el2);
});
</script>
<?php endif; ?>
<?php if(current_user_can('administrator') && 1==2): ?>
<div id="cover" class="d-none" style="position:fixed;z-index:99;width:100%;height:100%;left:0;top:0;background:rgba(0,0,0,0.5);"></div>
<div id="featured_items_div" class="postbox d-none" style="box-shadow:0px 0px 8px rgba(0,0,0,0.8);position:fixed;left:30%;top:30%;z-index:100;">
<div class="postbox-header">
<h2 style="padding-left:2rem;">Продвигаемые материалы</h2>
</div>
<div class="inside">
<div class="submitbox">
<div class="row d-none" style="padding:.5rem;">
<div class="col col-2">
<label>
<input type="radio" name="remove_featured" value="" />
</label>
</div>
</div>
<div class="row alignright" style="padding:1rem;">
<input type="button" class="button button-large" value="Отмена" id="cancel_featured" />
<input type="button" class="button button-primary button-large" value="Выбрать автоматически" id="remove_featured" />
</div>
</div>
</div>
</div>
<script>
jQuery(function($) {
$('#featured_items_div').on('change', 'input[name="remove_featured"]', function(){
$('#remove_featured').val('Выбрать');
});
$('#cancel_featured').on('click', function(){
$('#featured_items_div').find('.row.cloned').remove();
$('#remove_featured').val('Выбрать автоматически');
$('#featured_items_div, #cover').hide();
$('input[name="featured_post_promotion"]:checked').prop('checked', false).removeAttr('checked');
});
$('#remove_featured').on('click', function(){
if ($('input[name="remove_featured"]:checked').length === 0){
$('input[name="remove_featured"]').eq(1).attr('checked', true);
}
<?php $screen = get_current_screen(); ?>
<?php if ( in_array($screen->id, array('edit-yellow', 'edit-profile_article', 'edit-anew')) ): ?>
if ($('input[name="remove_featured"]:checked').length === 0){
$('#the-list tr input[name="featured_post_promotion"]').after(
$('<input>')
.attr('type', 'hidden')
.attr('name', 'remove_featured')
.val($('input[name="remove_featured"]').eq(1).val())
)
}else{
$('#the-list tr input[name="featured_post_promotion"]').after(
$('<input>')
.attr('type', 'hidden')
.attr('name', 'remove_featured')
.val($('input[name="remove_featured"]:checked').eq(0).val())
)
}
$('#featured_items_div').find('.row.cloned').remove();
<?php endif; ?>
$('#featured_items_div, #cover').hide();
});
$('input[name="featured_post_promotion"]').on('change', function(){
if(jQuery(this).is(':checked')){
$('#cover').show();
$.post( ajaxurl, {action: 'get_promoted'}, function(response) {
let data = JSON.parse(response);
if(data.length < 3){
$('#cover').hide();
return false;
}
data.forEach(function(item){
let elem = $('#featured_items_div').find('.row').eq(0).clone();
elem
.removeClass('d-none')
.addClass('cloned')
.find('input')
.val(item.ID)
.after(
function(){
if(item.popular_count > 0){
return $('<strong/>')
.html(' TOP: '+item.popular_count)
}
return false;
}
)
.after(
$('<a/>')
.html(item.post_title)
.attr('href', '/?p='+item.ID)
.attr('target', '_blank')
)
.after(
$('<span/>')
.html(item.post_date+' / ')
)
$('#featured_items_div').find('.row').eq(0).after(elem);
$('#featured_items_div').show();
});
});
}else{
$('#cover').hide();
$('input[name="remove_featured"][type="hidden"]').remove();
}
});
});
</script>
<?php endif; ?>
<?php if(get_current_user_id() == 58 && get_current_screen()->id == 'edit-anew' ): ?>
<script>
setTimeout(function(){
window.location.reload();
},60000);
</script>
<?php endif; ?>
<?php if(user_has_role(get_current_user_id(), 'newsline_editor') || user_has_role(get_current_user_id(), 'senior_editor')): ?>
<script>
jQuery('.title.column-title').each(function(){
jQuery(this).find('a.row-title').attr('href', '/?p='+jQuery(this).parents('tr').attr('id').replace('post-', ''));
});
</script>
<?php endif; ?>
<script>
jQuery('.post-state, .pending *, option, #post-status-display').html(
function(index,html){
return html.replace('На утверждении','Консервы');
}
);
jQuery('body').on('click', '.editinline', function(){
jQuery('.post-state, .pending *, option, #post-status-display').html(
function(index,html){
return html.replace('На утверждении','Консервы');
}
);
})
<?php if(in_array(get_post_type(), array('anew', 'profile_article', 'attachment'))): ?>
jQuery('input[name="post_type"]').val('<?= get_post_type(); ?>');
<?php endif; ?>
</script>
<script>
var $div = jQuery("#publish");
$div.click(function(){
window.readyForPublish = 'ready';
});
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.attributeName === "class") {
var attributeValue = jQuery(mutation.target).prop(mutation.attributeName);
console.log(attributeValue);
console.log(window.prevPubState);
if(attributeValue.indexOf('disabled') >= 0){
window.prevPubState = 'disabled';
}
if(window.prevPubState == 'disabled' && attributeValue == 'button button-primary button-large red' && window.readyForPublish == 'ready'){
//jQuery('form#post').submit();
//jQuery("#publish").click();
//jQuery('#publish').trigger('click');
document.getElementById('publish').click();
//jQuery("#publish").click();
}
}
});
});
observer.observe($div[0], {
attributes: true
});
$div.addClass('red');
</script>
<script>
/** только одна рубрика во вкладках ВСЕ и ЧАСТО ИСПОЛЬЗУЕМЫЕ */
jQuery(document).ready(function($) {
function getCategoryIdFromCheckbox(checkbox) {
const $checkbox = $(checkbox);
if ($checkbox.attr('name') === 'post_category[]') {
// Вкладка "Все"
return parseInt($checkbox.val(), 10);
} else {
// Вкладка "Часто используемые"
const idMatch = $checkbox.attr('id').match(/in-popular-category-(\d+)/);
return idMatch ? parseInt(idMatch[1], 10) : null;
}
}
function selectCategoryById(catId) {
// Сбросить все
$('#categorychecklist input[name="post_category[]"]').prop('checked', false);
$('#categorychecklist-pop input[id^="in-popular-category-"]').prop('checked', false);
// Установить соответствующие
$('#categorychecklist input[name="post_category[]"][value="' + catId + '"]').prop('checked', true);
$('#categorychecklist-pop input[id="in-popular-category-' + catId + '"]').prop('checked', true);
}
$(document).on('change', '#categorychecklist input[name="post_category[]"], #categorychecklist-pop input[id^="in-popular-category-"]', function() {
if ($(this).is(':checked')) {
const catId = getCategoryIdFromCheckbox(this);
if (catId !== null) {
selectCategoryById(catId);
}
}
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
const interval = setInterval(function () {
const popTab = document.querySelector('#category-tabs a[href="#category-pop"]');
const allTab = document.querySelector('#category-tabs a[href="#category-all"]');
const popPanel = document.getElementById('category-pop');
if (popTab && allTab && popPanel) {
const checked = popPanel.querySelectorAll('input[type="checkbox"]:checked');
if (checked.length === 0) {
allTab.click(); // Переключаемся на "Все рубрики"
}
clearInterval(interval); // Останавливаем цикл
}
}, 100);
});
</script>

346
admin-header.php Normal file
View File

@@ -0,0 +1,346 @@
<?php if(get_current_user_id() == 145): ?>
<style>
.misc-pub-section.curtime.misc-pub-curtime,
.inline-edit-date {
display:none !important;
}
</style>
<?php endif; ?>
<?php if(get_post_status(get_the_ID()) == 'publish' && !in_array(get_current_user_id(), [58,3,1])): ?>
<style>
#radio-categorydiv {
display:none!important;
}
</style>
<?php endif; ?>
<style>
#formatdiv, #commentstatusdiv, #trackbacksdiv, #postexcerpt, #slugdiv {
display:none!important;
}
pre{
margin-left:300px;
}
div[data-notice-name="update-44-notice"],
.inline-edit-status /*убираем статус в быстром редактировании*/,
#imgevr-offer-to-purchase,
.subsubsub .count
<?php if(!in_array(get_current_user_id(), array(16,58))): ?>
,.subsubsub .publish
<?php endif; ?>
{
display:none!important;
}
#the-list > tr.seo td.page-title strong {
text-indent:-9999px;
position:relative;
}
#the-list > tr.seo td.page-title strong a {
display:block;
text-indent:0px;
}
#poststuff #_submitdiv .inside {
margin: 0;
padding: 0;
}
</style>
<!--div style="position:fixed;width:100%;height:100%;top:0;left:0;z-index:999998;"></div-->
<?php if(current_user_can('corrector')): ?>
<style>
a[href^="post-new.php"],
input[name="publish"]{
display:none!important;
}
</style>
<?php endif; ?>
<?php if (!current_user_can('administrator') && !current_user_can('managing_editor')): ?>
<style>
#front-page-warning,
#front-static-pages ul,
.categorydiv ul.categorychecklist ul,
.customlinkdiv ul.categorychecklist ul,
.inline-editor ul.cat-checklist ul,
.posttypediv ul.categorychecklist ul,
.taxonomydiv ul.categorychecklist ul,
ul.export-filters {
margin-left:0px!important;
}
li[id^="category-"] > label,
li[id^="popular-category-"] {
display:none;
}
li[id="category-3394"] > label,
li[id="category-3394"] ul.children,
li[id="popular-category-3394"] {
display: block !important;
}
li[id="category-8529"] > label,
li[id="category-8529"] ul.children,
li[id="popular-category-8529"] {
display: block !important;
}
li[id="category-3392"] > label,
li[id="category-3392"] ul.children,
li[id="popular-category-3392"] {
display: block !important;
}
li[id="category-103061"] > label,
li[id="category-103061"] ul.children,
li[id="popular-category-103061"] {
display: block !important;
}
li[id="category-3388"] > label,
li[id="category-3388"] ul.children,
li[id="popular-category-3388"] {
display: block !important;
}
li[id="category-11430"] > label,
li[id="category-11430"] ul.children,
li[id="popular-category-11430"] {
display: block !important;
}
li[id="category-12857"] > label,
li[id="category-12857"] ul.children,
li[id="popular-category-12857"] {
display: block !important;
}
li[id="category-12876"] > label,
li[id="category-12876"] ul.children,
li[id="popular-category-12876"] {
display: block !important;
}
li[id="category-91781"] > label,
li[id="category-91781"] ul.children,
li[id="popular-category-91781"] {
display: block !important;
}
li[id="category-6973"] > label,
li[id="category-6973"] ul.children,
li[id="popular-category-6973"] {
display: block !important;
}
li[id="category-103061"] > label,
li[id="category-103061"] ul.children,
li[id="popular-category-103061"] {
display: block !important;
}
li[id="category-3358"] > label,
li[id="category-3358"] ul.children,
li[id="popular-category-3358"] {
display: block !important;
}
<?php
$menus = wp_get_nav_menus();
$menusToShow = array();
foreach ($menus as $menu){
$menuitems = wp_get_nav_menu_items($menu);
foreach($menuitems as $menuitem){
if($menuitem->object == 'category' && !in_array($menuitem->object_id, array(8529, 3358, 105049))){
echo "
li[id='category-".$menuitem->object_id."'] > label,
li[id='popular-category-".$menuitem->object_id."'] {
display:block !important;
}
";
}
}
}
?>
</style>
<?php endif; ?>
<?php if(1==2): ?>
<!-- Yandex.Metrika counter admin-header -->
<script type="text/javascript" >
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter62899390 = new Ya.Metrika({
id:62899390,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
trackHash:true
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img loading="lazy" src="https://mc.yandex.ru/watch/62899390" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<?php endif; ?>
<?php
if(user_has_role(get_current_user_id(), 'intern')){
?>
<style>
#menu-posts-yellow,
#menu-posts-profile_article,
#wp-admin-bar-new-yellow {
display:none;
}
</style>
<?php
}
if(user_has_role(get_current_user_id(), 'intern') || user_has_role(get_current_user_id(), 'newsline_editor') || user_has_role(get_current_user_id(), 'seniod_editor') || user_has_role(get_current_user_id(), 'authors')) : ?>
<style>
#menu-posts-profile_article > ul > li:nth-child(3),
#toplevel_page_wpseo_redirects,
#menu-pages,
#wp-admin-bar-delete-cache,
#menu-dashboard,
#wp-admin-bar-archive,
/*.subsubsub,*/
.subsubsub .trash,
.update-nag,
#menu-media > ul > li:last-of-type,
.alignleft.actions.bulkactions,
#wpseo-filter,
#wpseo-readability-filter,
#menu-comments,
#menu-tools,
#wp-admin-bar-new-custom-menu,
#wp-admin-bar-new-profile_article,
.yarpp-review-notice,
#wp-admin-bar-comments,
#wp-admin-bar-wpseo-menu,
#wp-admin-bar-amp
{display:none!important;}
</style>
<?php if(get_post_type() == 'profile_article'): ?>
<style>
div.row-actions,
#wp-admin-bar-edit,
#wpbody-content > div.wrap > a
{display:none!important;}
</style>
<?php endif; ?>
<?php endif; ?>
<?php
//Скрываем лишние колонки для Белоновской
if (in_array(get_current_user_id(), array(37))) : ?>
<style>
.column-comments,
.column-wpseo-links,
.column-wpseo-score,
.column-wpseo-score-readability,
.column-wpseo-title,
.column-wpseo-metadesc,
.column-wpseo-focuskw {
display:none;
}
.column-title.column-primary {
width:25%;
}
</style>
<?php endif; ?>
<?php if(current_user_can('bild')): ?>
<style>
#menu-posts-yellow,
#media-attachment-filters,
#media-attachment-date-filters,
button.media-button.select-mode-toggle-button,
#wp-admin-bar-new-yellow,
#wp-admin-bar-wpseo-menu,
#menu-comments,
#menu-posts-anew,
#menu-posts-profile_article,
#wp-admin-bar-comments,
#menu-tools,
#menu-users,
#wp-admin-bar-new-profile_article,
#wp-admin-bar-new-anew,
#wp-admin-bar-new-custom-menu,
.wp-submenu.wp-submenu-wrap > li:last-of-type,
/*select#author,*/
#post-query-submit,
#menu-dashboard,
#wp-admin-bar-my-account > div,
#attachment-filter {
display:none!important;
}
</style>
<?php endif; ?>
<?php if(!in_array(get_current_user_id(), array(1,3))): ?>
<style>
<?php $hide_categories = array(103061, 3390, 3392, 3393, 1, 3398, 3389, 3375, 3374, 3373, 3370, 3372, 6974, 3376, 3371, 3377, 8966, 3359, 3356, 3357, 3352, 3350, 3351, 3347, 3349, 8844, 8830, 3368, 3387, 3366, 3367, 3355, 3364, 3363, 3361, 3362, 3382, 3381, 3384, 3383); ?>
<?php foreach($hide_categories as $hc): ?>
li[id="category-<?php echo $hc; ?>"] > label,
li[id="popular-category-<?php echo $hc; ?>"] {
display: none!important;
position:absolute!important;
overflow:hidden!important;
width:0!important;
height:0!important;
position:fixed!important;
left:0!important;
top:0!important;
}
<?php endforeach; ?>
</style>
<?php endif; ?>
<style>
.coauthor-row img {
display:none;
}
.wpseo-score-icon {
width:16px;
height:16px;
background:#f17171;
border-radius:100%;
display:inline-block;
}
.wpseo-score-icon.good {
background:#a2d471;
}
#save-action > input,
#publishing-action > input {
float:left;
}
</style>
<link rel='stylesheet' type='text/css' href='<?php echo get_template_directory_uri(); ?>/assets/css/admin/jquery-ui.css' />

50
amp/_content-popular.php Normal file
View File

@@ -0,0 +1,50 @@
<div class="partners">
<div class="partners__header">
Самое читаемое
</div>
<div class="row">
<?php
global $wpdb;
$i = 0;
$current = get_the_ID();
$top = array_slice((array)json_decode(get_option('ppp_options')), 0, 4);
$notin = implode(",", array_map(function($item){return $item->id;},$top));
if(has_tag(103565, get_queried_object_id())){
$featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) order by post_date desc limit 11", OBJECT);
}else{
$featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id not in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = ".get_post_primary_category_id(get_queried_object_id()).") order by post_date desc limit 11", OBJECT);
}
$items = array_merge($top, $featured);
$has_with_tag = false;
foreach ($items as $item):
if(has_tag(7840, $item->id)){
if($has_with_tag === true){
continue;
}
$has_with_tag = true;
}
$post = get_post($item->id);
if ($item->id == $current){ continue; }
?>
<div class="col-12 col-md-4" data-id="<?php echo $id; ?>">
<a class="partners__item d-flex d-lg-block" href="<?php echo get_permalink($post); ?>?utm_from=must-amp">
<span class="partners__frame">
<amp-img width="142px" height="80px" src="<?php echo wp_get_attachment_image_src( get_post_thumbnail_id($post), 'thumbnail' )[0]; ?>" alt="<?php echo htmlspecialchars($post->post_title); ?>">
<noscript>
<img width="142px" height="80px" src="<?php echo wp_get_attachment_image_src( get_post_thumbnail_id($post), 'thumbnail' )[0]; ?>" alt="<?php echo htmlspecialchars($post->post_title); ?>" />
</noscript>
</amp-img>
</span>
<strong class="partners__item__title">
<?php echo $post->post_title; ?>
</strong>
</a>
</div>
<?php endforeach; ?>
</div>
</div>

8
amp/content-partners.php Normal file
View File

@@ -0,0 +1,8 @@
<div class="partners">
<amp-embed type="smi2"
width="auto"
height="330"
layout="fixed-height"
data-blockid="94892">
</amp-embed>
</div>

50
amp/content-popular.php Normal file
View File

@@ -0,0 +1,50 @@
<div class="partners">
<div class="partners__header">
Самое читаемое
</div>
<div class="row">
<?php
global $wpdb;
$i = 0;
$current = get_the_ID();
$top = array_slice((array)json_decode(get_option('ppp_options')), 0, 4);
$notin = implode(",", array_map(function($item){return (int)$item->id;},$top));
if(has_tag(103565, get_queried_object_id())){
$featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and 2=2 and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) order by post_date desc limit 11", OBJECT);
}else{
$featured = $wpdb->get_results("select id from wp_posts where id not in (".$notin.") and 3=3 and post_type in ('anew', 'yellow') and id != ".get_queried_object_id()." and post_status = 'publish' and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_hide_on_website' AND meta_value = '1' ) and id not in (SELECT post_id FROM wp_postmeta WHERE meta_key = '_only_link_access' AND meta_value = '1' ) and id not in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 103565 ) and id in (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = ".get_post_primary_category_id(get_queried_object_id()).") order by post_date desc limit 11", OBJECT);
}
$items = array_merge($top, $featured);
$has_with_tag = false;
foreach ($items as $item):
if(has_tag(7840, $item->id)){
if($has_with_tag === true){
continue;
}
$has_with_tag = true;
}
$post = get_post($item->id);
if ($item->id == $current){ continue; }
?>
<div class="col-12 col-md-4" data-id="<?php echo $id; ?>">
<a class="partners__item d-flex d-lg-block" href="<?php echo get_permalink($post); ?>?utm_from=must-amp">
<span class="partners__frame">
<amp-img width="142px" height="80px" src="<?php echo wp_get_attachment_image_src( get_post_thumbnail_id($post), 'thumbnail' )[0]; ?>" alt="<?php echo htmlspecialchars($post->post_title); ?>">
<noscript>
<img width="142px" height="80px" src="<?php echo wp_get_attachment_image_src( get_post_thumbnail_id($post), 'thumbnail' )[0]; ?>" alt="<?php echo htmlspecialchars($post->post_title); ?>" />
</noscript>
</amp-img>
</span>
<strong class="partners__item__title">
<?php echo $post->post_title; ?>
</strong>
</a>
</div>
<?php endforeach; ?>
</div>
</div>

32
amp/featured-image.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/**
* Post featured image template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
$featured_image = $this->get( 'featured_image' );
if ( empty( $featured_image ) ) {
return;
}
$amp_html = $featured_image['amp_html'];
$caption = $featured_image['caption'];
?>
<?php if ( show_thumbnail() ) : ?>
<figure class="amp-wp-article-featured-image wp-caption">
<?php the_post_thumbnail("thumb-1200"); ?>
<?php //echo $amp_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</figure>
<?php endif; ?>

52
amp/footer.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
/**
* Footer template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<footer class="amp-wp-footer">
<div>
<h2><?php echo esc_html( wptexturize( $this->get( 'blog_name' ) ) ); ?></h2>
<a href="#top" class="back-to-top"><?php esc_html_e( 'Back to top', 'amp' ); ?></a>
</div>
</footer>
<amp-analytics id="1qazxsw2<?=get_the_ID()?>" type="googleanalytics">
<script type="application/json">
{
"requests": {
"nextpage": "<?php get_permalink(get_the_ID()); ?>?amp=1"
},
"vars": {
"account": "UA-50205759-1"
},
"triggers": {
"trackScrollThrough": {
"on": "amp-next-page-scroll",
"request": "nextpage"
},
"trackClickThrough": {
"on": "amp-next-page-click",
"request": "nextpage"
},
"trackPageview": {
"on": "visible",
"request": "pageview"
}
}
}
</script>
</amp-analytics>

42
amp/header-bar.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
/**
* Header bar template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<header id="top" class="amp-wp-header">
<div>
<a href="<?php echo esc_url( $this->get( 'home_url' ) ); ?>">
<?php $site_icon_url = $this->get( 'site_icon_url' ); ?>
<?php if ( $site_icon_url ) : ?>
<amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
<?php endif; ?>
<span class="amp-site-title">
<?php echo esc_html( wptexturize( $this->get( 'blog_name' ) ) ); ?>
</span>
</a>
<?php $canonical_link_url = $this->get( 'post_canonical_link_url' ); ?>
<?php if ( $canonical_link_url ) : ?>
<?php $canonical_link_text = $this->get( 'post_canonical_link_text' ); ?>
<a class="amp-wp-canonical-link" href="<?php echo esc_url( $canonical_link_url ); ?>">
<?php echo esc_html( $canonical_link_text ); ?>
</a>
<?php endif; ?>
</div>
</header>

21
amp/header.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/**
* Header template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$this->load_parts( [ 'header-bar' ] );

25
amp/html-end.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
/**
* HTML end template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<?php do_action( 'amp_post_template_footer', $this ); ?>
</body>
</html>

36
amp/html-start.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
/**
* HTML start template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<!doctype html>
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<head>
<title><?php the_title(); ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<style amp-custom>
<?php $this->load_parts( [ 'style' ] ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
</style>
<script async custom-element="amp-next-page" src="https://cdn.ampproject.org/v0/amp-next-page-1.0.js"></script>
</head>
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">
<?php do_action( 'amp_post_template_body_open', $this ); ?>

30
amp/meta-author.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
/**
* Post author template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$post_author = $this->get( 'post_author' );
?>
<?php if ( $post_author ) : ?>
<div class="amp-wp-meta amp-wp-byline">
<?php if ( function_exists( 'get_avatar_url' ) ) : ?>
<amp-img src="<?php echo esc_url( get_avatar_url( $post_author->user_email, [ 'size' => 24 ] ) ); ?>" alt="<?php echo esc_attr( $post_author->display_name ); ?>" width="24" height="24" layout="fixed"></amp-img>
<?php endif; ?>
<span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,30 @@
<?php
/**
* Post comments link template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$comments_link_url = $this->get( 'comments_link_url' );
?>
<?php if ( $comments_link_url ) : ?>
<?php $comments_link_text = $this->get( 'comments_link_text' ); ?>
<div class="amp-wp-meta amp-wp-comments-link">
<a href="<?php echo esc_url( $comments_link_url ); ?>">
<?php echo esc_html( $comments_link_text ); ?>
</a>
</div>
<?php endif; ?>

47
amp/meta-taxonomy.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
/**
* Post taxonomy term list template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$categories = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'amp' ), '', $this->ID );
?>
<?php if ( $categories ) : ?>
<div class="amp-wp-meta amp-wp-tax-category">
<?php
/* translators: %s: list of categories. */
printf( esc_html__( 'Categories: %s', 'amp' ), $categories ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
<?php endif; ?>
<?php
$tags = get_the_tag_list(
'',
_x( ', ', 'Used between list items, there is a space after the comma.', 'amp' ),
'',
$this->ID
);
?>
<?php if ( $tags && ! is_wp_error( $tags ) ) : ?>
<div class="amp-wp-meta amp-wp-tax-tag">
<?php
/* translators: %s: list of tags. */
printf( esc_html__( 'Tags: %s', 'amp' ), $tags ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
</div>
<?php endif; ?>

26
amp/meta-time.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
/**
* Post date template part.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
?>
<div class="amp-wp-meta amp-wp-posted-on">
<time datetime="<?php echo esc_attr( date( 'c', $this->get( 'post_publish_timestamp' ) ) ); ?>">
<?php echo esc_attr( date( 'd.m.Y H:i', $this->get( 'post_publish_timestamp' ) ) ); ?>
</time>
</div>

41
amp/page.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
/**
* Page view template.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$this->load_parts( [ 'html-start' ] );
?>
<?php $this->load_parts( [ 'header' ] ); ?>
<article class="amp-wp-article">
<header class="amp-wp-article-header">
<h1 class="amp-wp-title"><?php echo esc_html( $this->get( 'post_title' ) ); ?></h1>
</header>
<?php $this->load_parts( [ 'featured-image' ] ); ?>
<div class="amp-wp-article-content">
<?php echo $this->get( 'post_amp_content' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
</article>
<?php $this->load_parts( [ 'footer' ] ); ?>
<?php
$this->load_parts( [ 'html-end' ] );

82
amp/single.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
/**
* Single view template.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$this->load_parts( [ 'html-start' ] );
?>
<?php $this->load_parts( [ 'header' ] ); ?>
<article class="amp-wp-article">
<header class="amp-wp-article-header">
<h1 class="amp-wp-title"><?php echo esc_html( $this->get( 'post_title' ) ); ?></h1>
<?php $this->load_parts( apply_filters( 'amp_post_article_header_meta', [ 'meta-author', 'meta-time' ] ) ); ?>
</header>
<?php if (has_secondary_title()): ?>
<h2 class="profile_onenews__subtitle mb-4">
<?= get_secondary_title(); ?>
</h2>
<?php endif; ?>
<?php
if ( function_exists( 'get_disclaimer' ) ) {
echo get_disclaimer();
}
?>
<?= get_first_pharagraph( get_the_content() ) ?>
<?php $this->load_parts( [ 'featured-image' ] ); ?>
<div class="amp-wp-article-content">
<?php echo $this->get( 'post_amp_content' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<div class="partners">
<?php if((int)get_option('show_ad') == 1): ?>
<amp-ad width="320" height="250"
type="adfox"
data-owner-id="242477"
data-adfox-params='{
"p1": "cizsc",
"p2": "fqzb"
}'>
<div placeholder></div>
<div fallback></div>
</amp-ad>
<?php endif; ?>
</div>
<?php $this->load_parts( [ 'content-partners' ] ); ?>
<?php $this->load_parts( [ 'content-popular' ] ); ?>
<footer class="amp-wp-article-footer">
<?php $this->load_parts( apply_filters( 'amp_post_article_footer_meta', [ 'meta-taxonomy', 'meta-comments-link' ] ) ); ?>
</footer>
</article>
<?php //$this->load_parts( [ 'footer' ] ); ?>
<?php
$this->load_parts( [ 'html-end' ] );

477
amp/style.php Normal file
View File

@@ -0,0 +1,477 @@
<?php
/**
* Style template.
*
* 🚫🚫🚫
* DO NOT EDIT THIS FILE WHILE INSIDE THE PLUGIN! Changes You make will be lost when a new version
* of the AMP plugin is released. You need to copy this file out of the plugin and put it into your
* custom theme, for example. To learn about how to customize these Reader-mode AMP templates, please
* see: https://amp-wp.org/documentation/how-the-plugin-works/classic-templates/
* 🚫🚫🚫
*
* @package AMP
*/
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
/**
* Context.
*
* @var AMP_Post_Template $this
*/
$content_max_width = absint( $this->get( 'content_max_width' ) );
$theme_color = $this->get_customizer_setting( 'theme_color' );
$text_color = $this->get_customizer_setting( 'text_color' );
$muted_text_color = $this->get_customizer_setting( 'muted_text_color' );
$border_color = $this->get_customizer_setting( 'border_color' );
$link_color = $this->get_customizer_setting( 'link_color' );
$header_background_color = $this->get_customizer_setting( 'header_background_color' );
$header_color = $this->get_customizer_setting( 'header_color' );
?>
/* Generic WP styling */
.alignright {
float: right;
}
.alignleft {
float: left;
}
.aligncenter {
display: block;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.amp-wp-enforced-sizes {
/** Our sizes fallback is 100vw, and we have a padding on the container; the max-width here prevents the element from overflowing. **/
max-width: 100%;
margin: 0 auto;
}
<?php echo file_get_contents( AMP__DIR__ . '/assets/css/amp-default.css' ); // phpcs:ignore WordPress.WP.AlternativeFunctions ?>
/* Template Styles */
.amp-wp-content,
.amp-wp-title-bar div {
<?php if ( $content_max_width > 0 ) : ?>
margin: 0 auto;
max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>;
<?php endif; ?>
}
html {
background: <?php echo sanitize_hex_color( $header_background_color ); ?>;
}
body {
background: <?php echo sanitize_hex_color( $theme_color ); ?>;
color: <?php echo sanitize_hex_color( $text_color ); ?>;
font-family: Georgia, 'Times New Roman', Times, Serif;
font-weight: 300;
line-height: 1.75em;
}
p,
ol,
ul,
figure {
margin: 0 0 1em;
padding: 0;
}
a,
a:visited {
color: <?php echo sanitize_hex_color( $link_color ); ?>;
}
a:hover,
a:active,
a:focus {
color: <?php echo sanitize_hex_color( $text_color ); ?>;
}
/* Quotes */
blockquote {
color: <?php echo sanitize_hex_color( $text_color ); ?>;
background: rgba(127,127,127,.125);
border-<?php echo is_rtl() ? 'right' : 'left'; ?>: 2px solid <?php echo sanitize_hex_color( $link_color ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
margin: 8px 0 24px 0;
padding: 16px;
}
blockquote p:last-child {
margin-bottom: 0;
}
/* UI Fonts */
.amp-wp-meta,
.amp-wp-header div,
.amp-wp-title,
.wp-caption-text,
.amp-wp-tax-category,
.amp-wp-tax-tag,
.amp-wp-comments-link,
.amp-wp-footer p,
.back-to-top {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
}
/* Header */
.amp-wp-header {
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;
}
.amp-wp-header div {
color: <?php echo sanitize_hex_color( $header_color ); ?>;
font-size: 1em;
font-weight: 400;
margin: 0 auto;
max-width: calc(840px - 32px);
padding: .875em 16px;
position: relative;
}
.amp-wp-header a {
color: <?php echo sanitize_hex_color( $header_color ); ?>;
text-decoration: none;
}
<?php if ( $this->get( 'post_canonical_link_url' ) || is_customize_preview() ) : ?>
.amp-wp-header .amp-wp-canonical-link {
font-size: 0.8em;
text-decoration: underline;
position: absolute;
<?php
$distance = 18;
if ( $this->get( 'site_icon_url' ) ) {
$distance += 32 + 10; // Width of site icon with margin.
}
printf( '%s: %dpx;', is_rtl() ? 'left' : 'right', $distance ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
}
<?php endif; ?>
.amp-wp-header .amp-wp-site-icon {
/** site icon is 32px **/
background-color: <?php echo sanitize_hex_color( $header_color ); ?>;
border: 1px solid <?php echo sanitize_hex_color( $header_color ); ?>;
border-radius: 50%;
position: absolute;
<?php echo is_rtl() ? 'left' : 'right'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>: 18px;
top: 10px;
}
/* Article */
.amp-wp-article {
color: <?php echo sanitize_hex_color( $text_color ); ?>;
font-weight: 400;
margin: 1.5em auto;
max-width: 840px;
overflow-wrap: break-word;
word-wrap: break-word;
}
/* Article Header */
.amp-wp-article-header {
align-items: center;
align-content: stretch;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 1.5em 16px 0;
}
.amp-wp-title {
color: <?php echo sanitize_hex_color( $text_color ); ?>;
display: block;
flex: 1 0 100%;
font-weight: 900;
margin: 0 0 .625em;
width: 100%;
}
/* Article Meta */
.amp-wp-meta {
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
display: inline-block;
flex: 2 1 50%;
font-size: .875em;
line-height: 1.5em;
margin: 0 0 1.5em;
padding: 0;
}
.amp-wp-article-header .amp-wp-meta:last-of-type {
text-align: <?php echo is_rtl() ? 'left' : 'right'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
.amp-wp-article-header .amp-wp-meta:first-of-type {
text-align: <?php echo is_rtl() ? 'right' : 'left'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
.amp-wp-byline amp-img,
.amp-wp-byline .amp-wp-author {
display: inline-block;
vertical-align: middle;
}
.amp-wp-byline amp-img {
border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;
border-radius: 50%;
position: relative;
margin-<?php echo is_rtl() ? 'left' : 'right'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>: 6px;
}
.amp-wp-posted-on {
text-align: <?php echo is_rtl() ? 'left' : 'right'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>;
}
/* Featured image */
.amp-wp-article-featured-image {
margin: 0 0 1em;
}
.amp-wp-article-featured-image amp-img {
margin: 0 auto;
}
.amp-wp-article-featured-image.wp-caption .wp-caption-text {
margin: 0 18px;
}
/* Article Content */
.amp-wp-article-content {
margin: 0 16px;
}
.amp-wp-article-content ul,
.amp-wp-article-content ol {
margin-<?php echo is_rtl() ? 'right' : 'left'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>: 1em;
}
.amp-wp-article-content .wp-caption {
max-width: 100%;
}
.amp-wp-article-content amp-img {
margin: 0 auto;
}
.amp-wp-article-content amp-img.alignright {
margin: 0 0 1em 16px;
}
.amp-wp-article-content amp-img.alignleft {
margin: 0 16px 1em 0;
}
/* Captions */
.wp-caption {
padding: 0;
}
.wp-caption.alignleft {
margin-right: 16px;
}
.wp-caption.alignright {
margin-left: 16px;
}
.wp-caption .wp-caption-text {
border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
font-size: .875em;
line-height: 1.5em;
margin: 0;
padding: .66em 10px .75em;
}
/* AMP Media */
.alignwide,
.alignfull {
clear: both;
}
amp-carousel {
background: <?php echo sanitize_hex_color( $border_color ); ?>;
margin: 0 -16px 1.5em;
}
amp-iframe,
amp-youtube,
amp-instagram,
amp-vine {
background: <?php echo sanitize_hex_color( $border_color ); ?>;
margin: 0 -16px 1.5em;
}
.amp-wp-article-content amp-carousel amp-img {
border: none;
}
amp-carousel > amp-img > img {
object-fit: contain;
}
.amp-wp-iframe-placeholder {
background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $this->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;
background-size: 48px 48px;
min-height: 48px;
}
/* Article Footer Meta */
.amp-wp-article-footer .amp-wp-meta {
display: block;
}
.amp-wp-tax-category,
.amp-wp-tax-tag {
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
font-size: .875em;
line-height: 1.5em;
margin: 1.5em 16px;
}
.amp-wp-comments-link {
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
font-size: .875em;
line-height: 1.5em;
text-align: center;
margin: 2.25em 0 1.5em;
}
.amp-wp-comments-link a {
border-style: solid;
border-color: <?php echo sanitize_hex_color( $border_color ); ?>;
border-width: 1px 1px 2px;
border-radius: 4px;
background-color: transparent;
color: <?php echo sanitize_hex_color( $link_color ); ?>;
cursor: pointer;
display: block;
font-size: 14px;
font-weight: 600;
line-height: 18px;
margin: 0 auto;
max-width: 200px;
padding: 11px 16px;
text-decoration: none;
width: 50%;
-webkit-transition: background-color 0.2s ease;
transition: background-color 0.2s ease;
}
/* AMP Footer */
.amp-wp-footer {
border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;
margin: calc(1.5em - 1px) 0 0;
}
.amp-wp-footer div {
margin: 0 auto;
max-width: calc(840px - 32px);
padding: 1.25em 16px 1.25em;
position: relative;
}
.amp-wp-footer h2 {
font-size: 1em;
line-height: 1.375em;
margin: 0 0 .5em;
}
.amp-wp-footer p {
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
font-size: .8em;
line-height: 1.5em;
margin: 0 85px 0 0;
}
.amp-wp-footer a {
text-decoration: none;
}
.back-to-top {
bottom: 1.275em;
font-size: .8em;
font-weight: 600;
line-height: 2em;
position: absolute;
<?php echo is_rtl() ? 'left' : 'right'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>: 16px;
}
.partners__header {
background: #ececec;
border-top: 2px solid #000;
font-size: 18px;
line-height: 1;
font-weight: 700;
text-transform: uppercase;
padding: 11px 15px;
margin-bottom: 5vw;
}
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
position: relative;
width: 100%;
padding-right: 15px;
padding-left: 15px;
}
.col-12 {
-webkit-box-flex: 0;
-webkit-flex: 0 0 100%;
-ms-flex: 0 0 100%;
flex: 0 0 100%;
max-width: 100%;
margin:0 5vw 0 5vw;
}
.partners__item.d-flex {
box-sizing:border-box;
color:rgb(0, 0, 0);
cursor:pointer;
display:flex;
font-size:14px;
font-weight:400;
line-height:21px;
margin:0px;
max-width:90vw;
padding:0 0 20px 0;
}
.partners__item.d-flex .partners__frame {
position: relative;
overflow: hidden;
min-width: 80px;
width: 80px;
height: 80px;
display:flex;
}
.partners__item__title {
display: inline-block;
line-height: 1.2;
margin: 0 0 0 1.25rem;
font-size: 1rem;
}

44
archive-allevents.php Normal file
View File

@@ -0,0 +1,44 @@
<?php get_header(); ?>
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9 order-2 order-sm-1">
<div class="d-flex justify-content-start align-items-center mb-3">
<h1 class="fs-38 font-weight-bold">
Календарь событий
</h1>
</div>
</div>
<div class="col-12 col-md-8 col-xl-9 order-2 order-sm-1">
<div class="row clearfix d-block">
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-event' );
else:
get_template_part( 'content', 'preview-short-event' );
endif;
endwhile;
?>
<?php
endif;
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-allevents').get_last_id().'" id="allevents_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="anew, yellow" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" ]');
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 order-1 order-sm-2">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<?php if(!wp_is_mobile()): ?>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>

43
archive-articles.php Normal file
View File

@@ -0,0 +1,43 @@
<?php get_header(); ?>
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9">
<div class="row clearfix d-block">
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-rubrick' );
else:
get_template_part( 'content', 'preview-short-rubrick' );
endif;
endwhile;
if(is_category()):
$cat = get_query_var('cat');
$category = get_category ($cat);
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-articles-category').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.get_option('posts_per_page').'" posts_per_page="10" category="'.$category->slug.'"]');
endif;
if(is_author()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-articles-author').get_queried_object_id().get_last_id().'" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.get_option('posts_per_page').'" posts_per_page="10" author="'.get_the_author_ID().'" ]');
endif;
?>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

88
archive-author.php Normal file
View File

@@ -0,0 +1,88 @@
<?php get_header(); ?>
<?php
$post = get_queried_object_id();
$email = str_replace("-", ".", get_post_meta($post, 'cap-user_login', true))."@news-profile.ru";
?>
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9">
<?php if(get_post_meta($post, 'show_data', true) == 1): ?>
<div class="author" itemscope itemtype="https://schema.org/Person">
<div class="position-relative d-flex flex-column flex-md-row">
<div class="text-center text-md-left">
<img itemprop="image" loading="lazy" class="author__img" src="<?php echo wp_get_attachment_image_src( get_post_thumbnail_id($post), 'thumbnail' )[0]; ?>" width="166" height="166" alt="<?php echo the_title(); ?>" />
</div>
<div class="d-flex flex flex-column align-items-center align-items-md-start justify-content-between">
<div class="author__body d-flex flex flex-column align-items-center align-items-md-start justify-content-center">
<h3 class="author__title mt-3 mt-md-0 mb-2 mb-md-2" itemprop="name">
<?php echo the_title(); ?>
</h3>
<div class="author__post text-center text-md-left py-1 py-md-0 mb-4 mb-md-0">
<a href="mailto:<?=$email?>" itemprop="email"><?=$email?></a>
</div>
<div class="author__post text-center text-md-left py-1 py-md-0 mb-4 mb-md-0">
<?= get_post_meta($post, 'cap-description', true); ?>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div class="row clearfix d-block">
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
$postNum = 0;
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-rubrick' );
else:
get_template_part( 'content', 'preview-short-rubrick' );
endif;
endwhile;
if (is_tag()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-author-tag').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" tag__and="'.get_queried_object()->term_id.'"]');
endif;
if(is_category()):
$cat = get_queried_object()->term_id;
$category = get_category ($cat);
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-author-category').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" category="'.$category->slug.'"]');
endif;
if(is_author()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-author-author').get_queried_object_id().get_last_id().'" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" author="'.get_the_author_meta('ID').'" ]');
endif;
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

72
archive-branding.php Normal file
View File

@@ -0,0 +1,72 @@
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9">
<?php if(is_in_dk()): ?>
<div class="dk-banner">
<img class="w-100 mb-4" src="<?= get_template_directory_uri() ?>/assets/img/Delovoy_club_852x80_2.jpg" />
</div>
<?php endif; ?>
<?php if (wp_is_mobile() && 1==2): ?>
<img loading="lazy" style="margin-bottom:30px;" src="<?php echo $taxImages->tax_logo_taxonomy_image_url( $termid, NULL, TRUE, 'taxonomy_logo_image' ); ?>" />
<?php endif; ?>
<?php if((is_branding() || is_branding_page()) && get_term_meta(get_queried_object()->term_id,'suptitle',1) != ''): ?>
<h6>
<a href="<?php echo get_term_meta(get_queried_object()->term_id,'link',1) ?>" target="_blank">
<?php echo get_term_meta(get_queried_object()->term_id,'suptitle',1) ?>
</a>
</h6>
<?php endif; ?>
<div class="story__title">
<?php echo get_term_meta(get_queried_object()->term_id,'subtitle',1); ?>
</div>
<?php echo str_replace("<p></p>", "", term_description( get_queried_object()->term_id )); ?>
<div class="<?php if(wp_is_mobile()): ?>col-12 <?php else: ?>row <?php endif; ?> clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-rubrick' );
else:
get_template_part( 'content', 'preview-short-rubrick' );
endif;
endwhile;
if(is_category()):
$cat = get_query_var('cat');
$category = get_category ($cat);
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-branding-author').get_queried_object_id().get_last_id().'2" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article, anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" post_format="standard" category="'.$category->slug.'"]');
endif;
if(is_author()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-branding-author').get_queried_object_id().get_last_id().'2" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.get_option('posts_per_page').'" posts_per_page="12" post_format="standard" author="'.get_the_author_ID().'" ]');
endif;
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,88 @@
<?php if(wp_is_mobile()): ?>
<style>
@media (min-width: 768px) {
.article__body {
min-height:100px;
}
}
</style>
<div class="row clearfix pb-5">
<div class="col-12">
<?php if((is_branding() || is_branding_page()) && get_term_meta(get_queried_object()->term_id,'suptitle',1) != ''): ?>
<h6>
<a href="<?php echo get_term_meta(get_queried_object()->term_id,'link',1) ?>" target="_blank">
<?php echo get_term_meta(get_queried_object()->term_id,'suptitle',1) ?>
</a>
</h6>
<?php endif; ?>
<div class="story__title">
<?php echo get_term_meta(get_queried_object()->term_id,'subtitle',1); ?>
</div>
<?php echo term_description( get_queried_object()->term_id ); ?>
<div class="row clearfix d-block pt-0 pt-md-3">
<?php get_template_part( 'content-menu-item-header' ); ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :;
the_post();
get_template_part( 'content', 'preview-short-rubrick-mamleev' );
endwhile;
if(is_category()):
$cat = get_query_var('cat');
$category = get_category ($cat);
//echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-branding-author').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article, anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" post_format="standard" category="'.$category->slug.'"]');
endif;
?>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
</div>
<?php else: ?>
<div class="row clearfix pb-5">
<div class="col-12 col-md-8 col-xl-9">
<?php if((is_branding() || is_branding_page()) && get_term_meta(get_queried_object()->term_id,'suptitle',1) != ''): ?>
<h6>
<a href="<?php echo get_term_meta(get_queried_object()->term_id,'link',1) ?>" target="_blank">
<?php echo get_term_meta(get_queried_object()->term_id,'suptitle',1) ?>
</a>
</h6>
<?php endif; ?>
<div class="story__title">
<?php echo get_term_meta(get_queried_object()->term_id,'subtitle',1); ?>
</div>
<?php echo term_description( get_queried_object()->term_id ); ?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) :;
the_post();
get_template_part( 'content', 'preview-short-rubrick-mamleev' );
endwhile;
if(is_category()):
$cat = get_query_var('cat');
$category = get_category ($cat);
//echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-branding-author').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article, anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" post_format="standard" category="'.$category->slug.'"]');
endif;
?>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>

68
archive-category.php Normal file
View File

@@ -0,0 +1,68 @@
<!--category-template-->
<?php get_header(); ?>
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9">
<?php if(is_in_dk()): ?>
<div class="dk-banner">
<img class="w-100 mb-4" src="<?= get_template_directory_uri() ?>/assets/img/Delovoy_club_852x80_2.jpg" />
</div>
<?php endif; ?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
$postNum = 0;
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-rubrick' );
else:
get_template_part( 'content', 'preview-short-rubrick' );
endif;
endwhile;
if (is_tag()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-category-tag').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" tag__and="'.get_queried_object()->term_id.'"]');
endif;
if(is_category()):
$cat = get_queried_object()->term_id;
$category = get_category ($cat);
if($category->slug == "columnist"){
#mail("viral@profile.ru","test",$wpdb->last_query);
}
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-category-category').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" category="'.$category->slug.'"]');
endif;
if(is_author()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-category-author').get_queried_object_id().get_last_id().'" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" author="'.get_the_author_ID().'" ]');
endif;
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

39
archive-events.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
$postNum = 0;
$post_type = (get_queried_object()->name == 'yellow') ? "yellow,anew" : get_queried_object()->name;
$y = ((int)get_query_var("event_year") > 0) ? (int)get_query_var("event_year") : '*';
$m = ((int)get_query_var("event_month") > 0) ? str_pad((int)get_query_var("event_month"), 2, '0', STR_PAD_LEFT) : '*';
$d = ((int)get_query_var("event_day") > 0) ? str_pad((int)get_query_var("event_day"), 2, '0', STR_PAD_LEFT) : '*';
?>
<div class="row clearfix d-block">
<div class="col-12 col-md-8 col-xl-9 order-2 order-sm-1">
<div class="d-flex justify-content-start align-items-center mb-3">
<h1 class="fs-38 font-weight-bold">
<a href="/events">Календарь событий</a>
</h1>
</div>
</div>
<div class="col-12 col-xl-9 float-left">
<div class="newslist">
<?php if ( have_posts() ) : ; ?>
<div class="newslist__result">
<?php while ( have_posts() ) : $postNum++; the_post(); ?>
<?php get_template_part( 'content', 'events' ); ?>
<?php endwhile; ?>
<?php //echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-events').((int)$y).((int)$m).((int)$d).get_last_id().'" custom_args="date:'.$y.'-'.$m.'-'.$d.'" id="events_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" offset="'.(get_option('posts_per_page')).'" posts_per_page="12" post_type="anew, yellow"]'); ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="col-12 col-xl-3 float-left d-none d-xl-block">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>

57
archive-news.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
$postNum = 0;
$post_type = (get_queried_object()->name == 'yellow') ? "yellow, anew" : get_queried_object()->name;
?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<div class="col-12 col-xl-9 float-left">
<div class="newslist">
<?php if ( have_posts() ) : ?>
<div class="newslist__result">
<?php while ( have_posts() ) : $postNum++; the_post(); ?>
<?php if(get_the_ID() != 910194): ?>
<?php ad_inlist_mobile($postNum); ?>
<?php get_template_part( 'content', 'news' ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php
$shortcode = '[ajax_load_more ';
if(!is_user_logged_in()){
$shortcode .= ' cache="true" cache_id="1'.wp_is_mobile().crc32('archive-news-'.$post_type).get_last_id().'" ';
}
$shortcode .= ' custom_args="type:short"
id="post_type_archive"
scroll_distance="50"
button_label="Загрузить еще"
container_type="div"
offset="'.(get_option('posts_per_page')).'"
posts_per_page="'.(get_option('posts_per_page')).'"
post_type="'.$post_type.'"
]';
?>
<?php echo do_shortcode($shortcode); ?>
</div>
<?php endif; ?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
</div>
</div>
<div class="col-12 col-xl-3 float-left d-none d-xl-block">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>

105
archive-post_tag.php Normal file
View File

@@ -0,0 +1,105 @@
<?php get_header(); ?>
<?php
$field = get_field("term_thumbnail", get_term(get_queried_object_id()));
?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<div class="col-12 col-xl-9 float-left">
<?php if($field > 0): ?>
<div class="newstag">
<img class="newstag__img d-none d-md-block" src="<?php echo wp_get_attachment_image_url($field, "large"); ?>" loading="lazy" />
<img class="newstag__img d-md-none" src="<?php echo wp_get_attachment_image_url($field, "thumbnail"); ?>" loading="lazy" />
<div class="newstag__body">
<div class="newstag__body__title d-flex flex-row align-items-md-baseline">
<img src="<?= get_template_directory_uri() ?>/assets/img/subtract.svg" />
<h1><?php echo ucfirst(get_term(get_queried_object_id())->name); ?></h1>
</div>
<div class="newstag__body__text d-none d-md-block">
<?php echo wpautop(get_term(get_queried_object_id())->description); ?>
</div>
</div>
</div>
<div class="newstag__body__text d-md-none mb-4">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
<?php else: ?>
<?php $image = get_option('z_taxonomy_image'.get_queried_object_id()); ?>
<?php if ($image != ''): ?>
<div class="newstag">
<img loading="lazy" class="newstag__img w-100" src="<?php echo $image; ?>" />
<div class="newstag__body">
<h1 class="newstag__body__title">
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
<svg width="35" height="35" class="align-baseline svg-icon">
<use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag-white"></use>
</svg>
</h1>
<div class="newstag__body__text">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
</div>
</div>
<?php else: ?>
<div class="onenews mb-0">
<h1 class="onenews__title">
<svg class="align-baseline svg-icon" width="36" height="37"><use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag"></use></svg>
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
</h1>
</div>
<?php if (get_term(get_queried_object_id())->description != '') : ?>
<div class="pt-4 pb-4 post-tag-description">
<?php echo wpautop(get_term(get_queried_object_id())->description); ?>
<div class="clearfix"></div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<div class="newslist">
<div class="newslist__result">
<?php if(get_queried_object_id() == 104756): ?>
<style>
.align-baseline.svg-icon {
display:none;
}
</style>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
get_template_part( 'content', 'post_tag' );
endwhile;
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-post_tag').get_queried_object_id().get_last_id().'" id="tag_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" tag__and="'.get_queried_object_id().'"]');
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 float-right">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

104
archive-post_tag_new.php Normal file
View File

@@ -0,0 +1,104 @@
<?php get_header(); ?>
<?php
$field = get_field("term_thumbnail", get_term(get_queried_object_id()));
?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<div class="col-12 col-xl-9 float-left">
<?php if($field > 0): ?>
<div class="newstag">
<img class="newstag__img" src="<?php echo wp_get_attachment_image_url($field, (wp_is_mobile() ? "thumbnail" : "large")); ?>" loading="lazy" />
<div class="newstag__body">
<div class="newstag__body__title d-flex flex-row align-items-md-baseline">
<img src="<?= get_template_directory_uri() ?>/assets/img/subtract.svg" />
<h1><?php echo ucfirst(get_term(get_queried_object_id())->name); ?></h1>
</div>
<div class="newstag__body__text d-none d-md-block">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
</div>
</div>
<div class="newstag__body__text d-md-none mb-4">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
<?php else: ?>
<?php $image = get_option('z_taxonomy_image'.get_queried_object_id()); ?>
<?php if ($image != ''): ?>
<div class="newstag">
<img loading="lazy" class="newstag__img w-100" src="<?php echo $image; ?>" />
<div class="newstag__body">
<h1 class="newstag__body__title">
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
<svg width="35" height="35" class="align-baseline svg-icon">
<use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag-white"></use>
</svg>
</h1>
<div class="newstag__body__text">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
</div>
</div>
<?php else: ?>
<div class="onenews mb-0">
<h1 class="onenews__title">
<svg class="align-baseline svg-icon" width="36" height="37"><use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag"></use></svg>
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
</h1>
</div>
<?php if (get_term(get_queried_object_id())->description != '') : ?>
<div class="pt-4 pb-4 post-tag-description">
<?php echo wpautop(get_term(get_queried_object_id())->description); ?>
<div class="clearfix"></div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<div class="newslist">
<div class="newslist__result">
<?php if(get_queried_object_id() == 104756): ?>
<style>
.align-baseline.svg-icon {
display:none;
}
</style>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
get_template_part( 'content', 'post_tag' );
endwhile;
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-post_tag').get_queried_object_id().get_last_id().'" id="tag_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" tag__and="'.get_queried_object_id().'"]');
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 float-right">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

81
archive-post_tag_old.php Normal file
View File

@@ -0,0 +1,81 @@
<?php get_header(); ?>
<?php $image = get_option('z_taxonomy_image'.get_queried_object_id()); ?>
<div class="row clearfix d-block">
<?php get_template_part( 'content-menu-item-header' ); ?>
<div class="col-12 col-xl-9 float-left">
<?php if ($image != ''): ?>
<div class="newstag">
<img loading="lazy" class="newstag__img w-100" src="<?php echo $image; ?>" />
<div class="newstag__body">
<h1 class="newstag__body__title">
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
<svg width="35" height="35" class="align-baseline svg-icon">
<use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag-white"></use>
</svg>
</h1>
<div class="newstag__body__text">
<?php echo (get_term(get_queried_object_id())->description); ?>
</div>
</div>
</div>
<?php else: ?>
<div class="onenews mb-0">
<h1 class="onenews__title">
<svg class="align-baseline svg-icon" width="36" height="37"><use xlink:href="/wp-content/themes/profile/assets/img/sprites-svg/dist/sprite.svg#tag"></use></svg>
<?php echo ucfirst(get_term(get_queried_object_id())->name); ?>
</h1>
</div>
<?php if (get_term(get_queried_object_id())->description != '') : ?>
<div class="pt-4 pb-4 post-tag-description">
<?php echo wpautop(get_term(get_queried_object_id())->description); ?>
<div class="clearfix"></div>
</div>
<?php endif; ?>
<?php endif; ?>
<div class="newslist">
<div class="newslist__result">
<?php if(get_queried_object_id() == 104756): ?>
<style>
.align-baseline.svg-icon {
display:none;
}
</style>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<?php
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
get_template_part( 'content', 'post_tag' );
endwhile;
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-post_tag').get_queried_object_id().get_last_id().'" id="tag_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article,anew" offset="'.(get_option('posts_per_page')).'" posts_per_page="10" tag__and="'.get_queried_object_id().'"]');
?>
<div class="hide-if-js">
<?php
the_posts_pagination(
[
'end_size' => 3,
'mid_size' => 3,
'prev_next' => 0,
]
);
?>
</div>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 float-right">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

60
archive-story.php Normal file
View File

@@ -0,0 +1,60 @@
<?php get_header(); ?>
<div class="row clearfix">
<div class="col-12 col-md-8 col-xl-9">
<div class="story">
<div class="story__body">
<?php if (strlen(get_term_meta(get_queried_object()->term_id,'link',1)) != 0): ?>
<a class="story__frame" href="<?php echo get_term_meta(get_queried_object()->term_id,'link',1); ?>" target="_blank">
<?php endif; ?>
<?php if (function_exists('z_taxonomy_image_url') && strlen(z_taxonomy_image_url()) != 0): ?>
<img loading="lazy" src="<?php echo z_taxonomy_image_url(); ?>" />
<?php endif; ?>
<?php if (strlen(get_term_meta(get_queried_object()->term_id,'link',1)) != 0): ?>
</a>
<?php endif; ?>
<h1 class="story__title">
<?php echo get_term_meta(get_queried_object()->term_id,'subtitle',1); ?>
</h1>
<?php echo term_description( get_queried_object()->term_id ); ?>
</div>
</div>
<div class="row clearfix d-block">
<?php if ( have_posts() ) : ?>
<?php
$rand = rand(4,5);
while ( have_posts() ) : $postNum++;
ad_inlist_mobile($postNum);
the_post();
if ($postNum == $rand && $already == false ):
$already = true;
get_template_part( 'content', 'preview-long-rubrick' );
else:
get_template_part( 'content', 'preview-short-rubrick' );
endif;
endwhile;
if(is_category()):
$cat = get_query_var('cat');
$category = get_category ($cat);
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-story-category').get_queried_object_id().get_last_id().'" id="category_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.get_option('posts_per_page').'" posts_per_page="10" post_format="standard" category="'.$category->slug.'"]');
endif;
if(is_author()):
echo do_shortcode('[ajax_load_more cache="true" cache_id="'.wp_is_mobile().crc32('archive-story-author').get_queried_object_id().get_last_id().'" id="author_request" scroll_distance="50" button_label="Загрузить еще" container_type="div" post_type="profile_article" offset="'.get_option('posts_per_page').'" posts_per_page="12" post_format="standard" author="'.get_the_author_ID().'" ]');
endif;
?>
<?php
else :
get_template_part( 'content', 'none' );
endif;
?>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3">
<div class="right-side">
<?php dynamic_sidebar('right_sidebar'); ?></div>
<div class="js-stickybit">
<?php get_template_part( 'content', 'ad' ); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

32
archive.php Normal file
View File

@@ -0,0 +1,32 @@
<!--[archive]-->
<?php get_header();?>
<div class="col-12 col-md-12 col-xl-9">
<?php get_template_part( "template-parts/archive/header" ) ?>
<?php if( is_post_type_archive() && !is_events() ) : ?>
<?php get_template_part( "template-parts/archive/list" ) ?>
<?php else : ?>
<?php get_template_part( "template-parts/archive/grid" ) ?>
<?php get_template_part( "template-parts/archive/ajax-load-more" ) ?>
<?php endif; ?>
</div>
<div class="col-12 col-md-4 col-xl-3 d-none d-xl-block">
<?php get_template_part( "template-parts/sidebar/right-sidebar" ) ?>
</div>
<?php get_footer(); ?>
<!--[/archive]-->

4309
article-styles.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
@media (max-width:768px){.tag{position:relative;margin-top:-13px}.pad-none{padding:0!important}.tag__body__title{position:relative;font-family:Roboto,sans-serif;font-style:normal;font-weight:700;font-size:32px;line-height:100%;color:#fff;margin:-40px 15px 0!important}.tag__body__title img{width:23px;margin-bottom:4px}.tag__body__text{font-family:Roboto,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:150%;margin-top:37px;padding-left:15px;padding-right:15px;padding-bottom:20px}.article__tag{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.taglist{padding-left:15px;padding-right:15px}.taglist__frame{width:100%}.taglist__frame img{width:100%;height:100%}.taglist__body{display:block;margin-top:22px;margin-bottom:17px}.taglist__title a{font-family:Roboto,sans-serif;font-style:normal;font-weight:700;font-size:18px}.taglist__text{display:none}.taglist:before{content:'';display:block;border-top:1px solid silver;margin-bottom:17px}.tag-item{background:#ececec;border-radius:5px;margin-right:17px;margin-bottom:14px}.tag-item a{font-family:Roboto,sans-serif;font-style:normal;font-weight:700;font-size:14px;line-height:155.4%;text-align:center;white-space:nowrap;padding-left:8px;padding-right:8px;padding-bottom:2px}.marks{font-family:Roboto,sans-serif;font-style:normal;font-weight:400;font-size:16px;line-height:155.4%;margin-right:18px}.article__tag .publication__data{margin-bottom:33px!important}.tag__img{-webkit-filter:brightness(45%);filter:brightness(45%)}}

View File

@@ -0,0 +1 @@
@media (min-width:768px){.tag{position:relative;margin-bottom:22px}.tag:after{content:'';display:block;border-bottom:1px solid silver;padding-top:26px}.tag-item{background:#ececec;border-radius:2px;margin-right:18px;padding-bottom:3px}.tag-item a{font-family:Roboto,sans-serif;font-style:normal;font-weight:700;font-size:12px;padding-left:7px;padding-right:7px;line-height:105.47%}.tag__body{position:absolute;bottom:63px;color:#fff;left:27px}.tag__body__title{font-family:Roboto,sans-serif;font-style:normal;font-weight:700;font-size:48px;line-height:1;margin-bottom:13px!important}.tag__body__text{margin-left:50px;max-width:716px}.tag__body__title img{margin-bottom:11px}.tag__img{width:100%;max-height:480px;-webkit-filter:brightness(45%);filter:brightness(45%)}.taglist{margin-bottom:26px}.taglist:after{content:'';display:block;border-bottom:1px solid silver;padding-top:26px}.taglist__title{margin-bottom:10px!important}.taglist__title a{width:100%;height:100%;display:block;font-size:26px;margin-top:-3px}.taglist__text{display:block;margin-bottom:14px;font-size:14px}.taglist__frame{width:100%;max-width:224px;height:100%;max-height:126px;margin-right:20px}.taglist__frame img{max-width:224px;height:100%;max-height:126px}.marks{margin-right:20px}}

19
assets/css/admin/app.css Normal file
View File

@@ -0,0 +1,19 @@
.mce-statusbar.mce-container.mce-panel.mce-stack-layout-item.mce-last {
border: 1px solid #e5e5e5;
border-top: none;
background-color: #f7f7f7;
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
z-index: 999;
}
.mce-container-body.mce-flow-layout .mce-charactercount.mce-widget.mce-label.mce-flow-layout-item.mce-first {
width: 100%;
border-spacing: 0;
font-size: 12px;
padding: 2px 10px;
}
.mce-btn-group, .mce-btn-group > div{width:auto!important;height:auto!important;}
#wp-admin-bar-new-post,
#wp-admin-bar-new-page,
#menu-posts {
display:none;
}

View File

@@ -0,0 +1,5 @@
[data-wpview-text*="profile.ru"] {
max-width:16.5rem;
float:right;
}
.mce-btn-group, .mce-btn-group > div{width:auto!important;height:auto!important;}

6
assets/css/admin/jquery-ui.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
assets/css/font-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/fonts/lg.eot Normal file

Binary file not shown.

BIN
assets/fonts/lg.ttf Normal file

Binary file not shown.

BIN
assets/fonts/lg.woff Normal file

Binary file not shown.

View File

@@ -0,0 +1,24 @@
@font-face {
font-family: 'PT Sans';
src: local('PT Sans'), local('PTSans-Regular'), url('ptsans.woff2') format('woff2'), url('ptsans.woff') format('woff'), url('ptsans.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'PT Sans';
src: local('PT Sans Italic'), local('PTSans-Italic'), url('ptsansitalic.woff2') format('woff2'), url('ptsansitalic.woff') format('woff'), url('ptsansitalic.ttf') format('truetype');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'PT Sans';
src: local('PT Sans Bold'), local('PTSans-Bold'), url('ptsansbold.woff2') format('woff2'), url('ptsansbold.woff') format('woff'), url('ptsansbold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'PT Sans';
src: local('PT Sans Bold Italic'), local('PTSans-BoldItalic'), url('ptsansbolditalic.woff2') format('woff2'), url('ptsansbolditalic.woff') format('woff'), url('ptsansbolditalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More