-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
50 lines (50 loc) · 2.57 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php get_header(); ?>
<?php if (have_posts()): ?>
<section>
<h2 class="ui segment horizontal divider header main-caption">Результаты поиска для: "<?php echo get_search_query(); ?>"</h2>
<div class="ui special cards cards-block">
<?php while (have_posts()) : the_post(); ?>
<article class="card one-card">
<div class="blurring dimmable image">
<div class="ui dimmer">
<div class="content">
<div class="center">
<span class="ui inverted button">Скачать</span>
</div>
</div>
</div>
<?php if (has_post_thumbnail()): ?>
<?php the_post_thumbnail('', array('class' => 'ui fluid image', 'alt' => trim(strip_tags( $wp_postmeta->_wp_attachment_image_alt )))); ?>
<?php elseif (get_post_meta($post->ID, 'img_url', 1)): ?>
<img class="ui fluid image" src="<?php echo get_post_meta($post->ID, 'img_url', 1); ?>" alt="<?php echo get_post_meta($post->ID, 'img_alt', 1); ?>">
<?php else: ?>
<img class="ui fluid image" src="<?php echo get_template_directory_uri() . '/img/noimg.jpg' ?>" alt="<?php the_title(); ?> - <?php echo get_post_meta($post->ID, 'album', true); ?><?php echo ' - '.get_post_meta($post->ID, 'year', 1); ?>">
<?php endif; ?>
</div>
<header class="content">
<h3 class="card-link-h">
<a class="card-link" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
<span class="card-album"><?php echo get_post_meta($post->ID, 'album', true); ?><?php echo ' - '.get_post_meta($post->ID, 'year', 1); ?></span>
</a>
</h3>
<div class="meta display-none">
<i class="tags icon"></i><?php the_category(', ', 'single'); ?>
</div>
<div class="description display-none"><?php the_excerpt(); ?></div>
</header>
<footer class="extra content display-none">
<time class="right floated" datetime="<?php the_time('Y-m-d') ?>"><i class="wait icon"></i><?php the_time('d.m.Y') ?></time>
<a href="<?php the_permalink() ?>#comments"><span class="card-footer"><?php comments_number('<i class="talk outline icon"></i>нет комментариев', '<i class="talk icon"></i>1 комменатрий', '<i class="talk icon"></i>% комментариев'); ?></span></a>
</footer>
</article>
<?php endwhile; ?>
</div>
</section>
<?php echo get_pagination(); ?>
<?php else: ?>
<div class="ui negative message">
<div class="header search-noresult">По запросу: "<?php echo get_search_query(); ?>" ничего не найдено</div>
</div>
<?php endif; ?>
<?php get_footer(); ?>