arc-hive-wordpress-theme/search.php

77 lines
2.7 KiB
PHP
Raw Normal View History

2022-04-11 03:31:19 +02:00
<?php
/**
* The search template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* e.g., it puts together the home page when no home.php file exists.
*
* Learn more: {@link https://codex.wordpress.org/Template_Hierarchy}
*
* @package arcHIVE-theme
* @since arcHIVE-theme 1.0.0
*/
get_header(); ?>
2022-04-11 03:51:19 +02:00
<?php get_template_part( 'template-parts/announcement' ); ?>
2022-04-11 03:31:19 +02:00
<article>
<main>
2022-04-11 03:51:19 +02:00
<section class="search-results-content">
2022-04-11 03:31:19 +02:00
<header>
<h4>search results for:</h4>
<h2>
<span class="search-query-terms">
<?php echo get_search_query( ); ?>
</h2>
</header>
<aside class="hero hero-announcement resources">
<?php dynamic_sidebar( 'announcement-resources-middle-widgets' ); ?>
</aside>
2022-04-11 03:31:19 +02:00
<main class="">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article class="">
<?php if ( has_post_thumbnail() ) :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo get_the_post_thumbnail_url();?>);">
</figure>
</a>
<?php else :?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<figure style="background-image: url(<?php echo catch_post_first_image();?>);">
</figure>
</a>
<?php endif;?>
<h5 class="date">
2022-04-11 03:51:19 +02:00
<?php //the_date('d.m.Y');?>
2022-04-11 03:31:19 +02:00
</h5>
<h3 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h3>
<section class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
<?php the_excerpt() ?>
</a>
</section>
</article>
<?php endwhile;//end of the loop ?>
</main>
<?php //pagination here ?>
<aside>
<nav>
<!--a href="" class="button hollow">see more news</a-->
</nav>
</aside>
<?php else : //if no post in query ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
</main>
</article>
2022-04-11 03:31:19 +02:00
<?php get_footer();