-
Notifications
You must be signed in to change notification settings - Fork 1
/
search.php
63 lines (47 loc) · 2.05 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
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package medium_magazin_beta
*/
get_header(); ?>
<section id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php if ( have_posts() ) : ?>
<div class="row">
<header class="page-header col-12 p-3 mb-4 text-center" style="background-color: <?php echo mmbeta_color('petrol'); ?>">
<h1 class="page-title">
<?php printf( esc_html__( 'Suchergebnisse für: %s', 'mmbeta' ), '<span>' . get_search_query() . '</span>' ); ?>
</h1>
</header><!-- .page-header -->
</div>
<div class="d-flex justify-content-center flex-row flex-wrap">
<?php while ( have_posts() ) : the_post(); ?>
<article class="container col-12 col-md-10 col-lg-8 d-flex flex-row flex-wrap justify-content-center">
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); ?>
<?php if ($image): ?>
<div class="col-12 col-md-4 d-flex justify-content-center">
<a class="img-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<figure class="figure">
<?php echo wp_get_attachment_image(get_post_thumbnail_id( $post->ID ), 'cover', false, array('class' => 'img-responsive figure-img') ); ?>
</figure>
</a>
</div>
<?php endif; ?>
<div class="col-12 col-md-8">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<h2><?php the_title(); ?></h2>
</a>
<div class="lead"><?php the_excerpt(); ?></div>
</div>
</article>
<?php endwhile; ?>
</div>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</section><!-- #primary -->
<?php get_footer(); ?>