biofriction-wp-theme/biofriction-theme/home.php

67 lines
2.4 KiB
PHP
Raw Normal View History

2021-02-18 15:27:46 +01:00
<?php
/**
* The main 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 Biofriction
* @since Biofriction 1.0.0
*/
get_header(); ?>
<div class="main-container">
<div class="main-grid">
<main class="main-content">
<div class="bfr_category_archive">
<?php // Start the Loop ?>
2021-10-25 15:53:54 +02:00
<?php // category 12 is the "peephole" category in the 2021 installation,?>
<?php // if starting from new install this might change, check the category number that you want to hide ?>
2021-10-25 15:53:54 +02:00
<?php //$query = new WP_Query( 'cat=-12' ); ?>
<?php //if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
<?php // coment above, uncoment below to query all posts ?>
2021-10-25 15:53:54 +02:00
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
2021-02-18 15:27:46 +01:00
<article id="post-<?php the_ID(); ?>" <?php post_class('bfr_post'); ?>>
<div class="bfr_post_content">
<header>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
</header>
<div class="bfr_post_thumbnail">
<?php if ( has_post_thumbnail() ) :?>
<img src="<?php echo get_the_post_thumbnail_url();?>" />
<?php else :?>
<img src="<?php echo catch_post_first_image();?>" />
<?php endif;?>
</div>
<footer>
<div class="excerpt post-excerpt">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"></a>
<?php echo wp_strip_all_tags( get_the_excerpt(), true ); ?>
</div>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>" class="button">
Read more
</a>
</footer>
</div>
</article>
<?php endwhile; // End loop. ?>
<?php wp_reset_postdata(); ?>
</div>
<?php get_template_part( 'template-parts/navigation', 'prevnext' ); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; // End have_posts. ?>
</main>
</div>
</div>
<?php get_footer();