Files
profile/404.php
Andrey Kuvshinov 8fc8cbae32 add files
2025-07-09 21:21:17 +03:00

82 lines
4.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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-->