add files
This commit is contained in:
70
content-preview-long-event-ad.php
Normal file
70
content-preview-long-event-ad.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
$cat = get_post_primary_category(get_the_ID());
|
||||
$cat = $cat['primary_category'];
|
||||
?>
|
||||
<?php if (is_single()): ?>
|
||||
<?php if (get_post_format()): ?>
|
||||
<?php get_template_part( 'content', get_post_format() ); ?>
|
||||
<?php else: ?>
|
||||
<?php get_template_part( 'content-page' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<div class="col-12 col-md-6 col-xl-8 float-left">
|
||||
<div class="article cell">
|
||||
<a class="article__frame article__frame--wide" href="<?php echo esc_url( get_permalink() ); ?>">
|
||||
<?php if (has_post_thumbnail()): ?>
|
||||
<?php if(wp_is_mobile()): ?>
|
||||
<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,'medium'); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
|
||||
<?php else: ?>
|
||||
<img loading="lazy" class="d-block lazyload" width="560px" height="315px" <?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,'medium'); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
|
||||
<?php endif; ?>
|
||||
<?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 else: ?>
|
||||
<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="<?= get_template_directory_uri() ?>/assets/img/event-cover.jpg" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php if ($cat->category_parent != 1): ?>
|
||||
<span class="sticker-group">
|
||||
<?php if(in_array(get_post_type(), array('anew','yellow'))): ?><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 date("d.m.Y", strtotime(get_post_meta(get_the_ID(),'event_date',true))); ?>" class="article__data event__data">
|
||||
<?php echo date("d.m.Y", strtotime(get_post_meta(get_the_ID(),'event_date',true))); ?>
|
||||
</time>
|
||||
<a class="article__title" href="<?php echo esc_url( get_permalink() ); ?>">
|
||||
<?php the_title(); ?>
|
||||
</a>
|
||||
<div class="article__detail">
|
||||
<?php if (!in_array(get_post_type(), array('anew','yellow')) && $cat->term_id !== 3401): ?>
|
||||
<?php get_template_part( 'author', 'article' ); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!wp_is_mobile() && 1==2): ?>
|
||||
<?php $rand=rand(); ?>
|
||||
<div class="cell special__multi special--gray cell d-flex justify-content-center align-items-center adfox-hidden position-absolute adfox" style="width:560px;height:264px;">
|
||||
<div id="adfox_158402234865383335_<?php echo $rand; ?>" class="js-hide-notload"></div>
|
||||
<script>
|
||||
(function(w, n) {
|
||||
w[n] = w[n] || [];
|
||||
w[n].push({
|
||||
ownerId: 242477,
|
||||
containerId: 'adfox_158402234865383335_<?php echo $rand; ?>',
|
||||
params: {
|
||||
p1: 'cjkre',
|
||||
p2: 'fple'
|
||||
}
|
||||
});
|
||||
})(window, 'adfoxAsyncParams');
|
||||
</script>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<!--preview-long-event-ad-->
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user