Add basic list archive template

This commit is contained in:
Ben Goldsworthy 2021-02-06 15:09:22 +00:00
parent dd6e4932f3
commit 0a2e902c89
3 changed files with 68 additions and 0 deletions

41
archive-quotes.php Normal file
View file

@ -0,0 +1,41 @@
<?php
/**
* The template for displaying portfolio archives.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
get_header(); ?>
<main id="list-page" class="col-10 col-m-12" role="main">
<header>
<h1>Quotes.</h1>
</header>
<section class="row">
<ul>
<?php
if ( have_posts() ) :
// Start the loop.
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'list-simple' );
// End the loop.
endwhile;
// If no content, include the "No posts found" template.
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</ul>
</section><!-- .site-main -->
</main><!-- .content-area -->
<?php get_footer(); ?>

View file

@ -1489,3 +1489,7 @@ summary {
font-size: 1.1em; font-size: 1.1em;
font-weight: bold; font-weight: bold;
} }
#list-page ul {
width: 100%;
}

View file

@ -0,0 +1,23 @@
<?php
/**
* The template part for displaying lists of simple items.
*
* @package Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
?>
<li id="<?php echo esc_attr( get_the_ID() ); ?>" <?php post_class(); ?>>
<a class="item" href="<?php echo esc_url( get_the_permalink() ); ?>">
<?php echo wp_kses_post( get_the_title() ); ?>
<?php
$subtitle = get_post_meta( get_the_ID(), 'Subtitle', true );
if ( $subtitle ) :
?>
: <?php echo wp_kses_post( $subtitle ); ?>
<?php
endif;
?>
</a>
</li>