Files
profile/content-page-template-profile_article.php

142 lines
9.4 KiB
PHP
Raw Normal View History

2025-07-09 21:21:17 +03:00
<?php $post = get_post(get_queried_object_id()); ?>
<?php $adfoxDate = date("U"); ?>
<div class="js-ajax-data">
<div class="row clearfix">
<!--this is pa-->
<div class="col-12 col-xl-9 float-left">
<div class="onenews" itemscope itemtype="https://schema.org/NewsArticle">
<link itemprop="mainEntityOfPage" href="<?php echo get_permalink(); ?>"/>
<div class="d-none" itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<div class="d-none" itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="url" content="<?= get_template_directory_uri() ?>/assets/img/profil-logo.png"/>
</div>
<meta itemprop="name" content="<?php bloginfo(); ?>"/>
<link itemprop="url" content="<?php echo home_url(); ?>"/>
</div>
<span itemprop="articleSection" class="d-none"><?php the_category(); ?></span>
<meta itemprop="inLanguage" content="ru"/>
<meta itemprop="dateModified" content="<?php echo the_modified_date("c "); ?>"/>
<h1 itemprop="name headline" class="onenews__title"
data-url="<?php echo esc_url(get_permalink()); ?>">
<?php the_title(); ?>
</h1>
<?php if (has_secondary_title()): ?>
<h4 class="onenews__subtitle d-lg-flex">
<?php echo get_secondary_title(); ?>
</h4>
<?php endif; ?>
<div class="publication__data">
<span class="publication__number" itemprop="datePublished"
content="<?php echo get_the_date("Y-m-d"); ?>">
<?php if (is_array(get_post_custom_values('num'))): ?>
<?php echo array_shift(get_post_custom_values('num')); ?>
<?php else: ?>
<?php echo get_the_date("d.m.Y") ?>
<?php if (get_post_type() == 'anew'): ?>
<?php echo get_the_time("H:i") ?>
<?php endif; ?>
<?php endif; ?>
</span>
<?php if (in_array(get_post_type(), array('anew', 'yellow'))): ?>
<?php get_template_part('author', 'news'); ?>
<?php else: ?>
<?php get_template_part('author', 'single'); ?>
<?php endif; ?>
</div>
<div class="onenews__body">
<div class="stick js-stickybit d-none d-lg-block">
<!--div class="ya-share2" data-services="facebook,vkontakte,twitter,telegram,odnoklassniki"></div-->
<?php echo share_block(get_the_ID()); ?>
</div>
<?php if (has_post_thumbnail() && show_thumbnail()): ?>
<figure itemprop="image" itemscope itemtype="https://schema.org/ImageObject" id="attachment_<?php echo get_post_thumbnail_id(); ?>">
<link itemprop="url" href="<?php echo get_the_post_thumbnail_url(get_queried_object_id(), 'large'); ?>" />
<link itemprop="contentUrl" href="<?php echo get_the_post_thumbnail_url(get_queried_object_id(), 'large'); ?>" />
<?php echo get_the_post_thumbnail($post, array(782, 440)); ?>
<?php $thumb = get_post(get_post_thumbnail_id()); ?>
<figcaption itemprop="description">
<?php if (strlen($thumb->post_content) !== 0): ?>
<p><?php echo $thumb->post_content; ?></p>
<?php endif; ?>
<?php if (strlen($thumb->post_excerpt) !== 0 && !strposa($thumb->post_excerpt, ['instag', 'faceb', 'инстаг'])): ?>
<span>©<?php echo str_replace(array("Фото: ", "Фото:"), "", main_photo_caption($thumb->post_excerpt)); ?></span>
<?php endif; ?>
</figcaption>
</figure>
<?php endif; ?>
<div class="micromarking" itemprop="articleBody"
data-post-type="<?php echo get_post_type(); ?>">
<?php
global $more;
$more = 1;
echo the_content();
?>
</div>
<div class="stick js-stickybit d-xs-none d-lg-none">
<!--div class="ya-share2" data-services="facebook,vkontakte,twitter,telegram,odnoklassniki"></div-->
<?php echo share_block(get_the_ID()); ?>
</div>
</div>
</div>
<?php
if (!get_post_meta(get_the_ID(), '_hide_related', true) && function_exists('yarpp_related')) {
yarpp_related(array("post_type" => array(get_post_type())), get_the_ID(), true);
}
?>
<div class="read-yzd">
<?php if (get_post_type(get_queried_object_id()) == 'profile_article'): ?>
Избранные статьи в <a href="tg://resolve?domain=profilejournal" target="_blank"
rel="noopener">telegram-канале <span class="read-yzd__red">ProfileJournal</span></a>
<?php else: ?>
Оперативные и важные новости в нашем <a href="tg://resolve?domain=profile_newzzz"
target="_blank" rel="noopener">telegram-канале <span
class="read-yzd__red">Профиль-News</span></a>
<?php endif; ?>
<br/>
Больше интересного на канале <a rel="noopener" href="https://zen.yandex.ru/profile.ru?clid=300"
target="_blank"><span class="read-yzd__red">Дзен</span>-Профиль</a>
</div>
<?php get_template_part('content', 'post_tags'); ?>
<?php /*
<div class="read-yzd mobile-only">
<div>Скачайте мобильное приложение и читайте журнал "Профиль" бесплатно:</div>
<a class="float-xs-none float-md-left mobile-button mobile-ios" href="https://apps.apple.com/ru/app/id6476872853" target="_blank">
<img loading="lazy" src="<?= get_template_directory_uri() ?>/assets/img/appstore.png" width="103" height="32" alt="" />
</a>
<a class="float-xs-none float-md-left mobile-button mobile-not-ios" href="https://play.google.com/store/apps/details?id=com.quazarteam.Profile" target="_blank">
<img loading="lazy" src="<?= get_template_directory_uri() ?>/assets/img/googleplay.png" width="115" height="32" alt="" />
</a>
</div>
*/ ?>
<!-- [Popular] -->
<?php get_template_part('content', 'popular'); ?>
<!-- [/Popular] -->
<div class="partners pb-4">
<?php get_template_part("adfox_ad_block_inread_mobile-1"); ?>
</div>
<!-- [Partners] -->
<?php //get_template_part('content', 'partners' . ((wp_is_mobile()) ? '-mobile' : '')); ?>
</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 class="row clearfix d-block">
<?php
$mob = wp_is_mobile() ? "01" : "00";
$pt = get_post_type(get_queried_object_id()) == "profile_article" ? "01" : "00";
$cache_id = "01";
//cache_id="' . wp_is_mobile() . crc32('content-page-article') . get_queried_object_id() . '"
?>
<?php $shortcode = '[ajax_load_more cache="true" cache_id="'.$mob.$pt.$cache_id.'" id="after_post_request" post_type="profile_article" post_format="standard" category__and="' . $postcat->term_id . '" button_label="Загрузить еще" posts_per_page="14" scroll_distance="50" container_type="div" post__not_in="' . get_queried_object_id() . '"]'; ?>
<?php echo do_shortcode($shortcode); ?>
</div>
</div>
</div>