first
This commit is contained in:
41
wp-content/themes/simple-theme/template-parts/archive.php
Normal file
41
wp-content/themes/simple-theme/template-parts/archive.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
<main class="site-main" role="main">
|
||||
|
||||
<header class="page-header">
|
||||
|
||||
</header>
|
||||
<div class="page-content">
|
||||
<?php
|
||||
while ( have_posts() ) {
|
||||
the_post();
|
||||
$post_link = get_permalink();
|
||||
?>
|
||||
<article class="post">
|
||||
<?php
|
||||
printf( '<h2 class="%s"><a href="%s">%s</a></h2>', 'entry-title', esc_url( $post_link ), esc_html( get_the_title() ) );
|
||||
printf( '<a href="%s">%s</a>', esc_url( $post_link ), get_the_post_thumbnail( $post, 'large' ) );
|
||||
the_excerpt();
|
||||
?>
|
||||
</article>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php wp_link_pages(); ?>
|
||||
|
||||
<?php
|
||||
global $wp_query;
|
||||
if ( $wp_query->max_num_pages > 1 ) :
|
||||
?>
|
||||
<nav class="pagination" role="navigation">
|
||||
<?php /* Translators: HTML arrow */ ?>
|
||||
<div class="nav-previous"><?php next_posts_link( sprintf( __( '%s older', gV('slug') ), '<span class="meta-nav">←</span>' ) ); ?></div>
|
||||
<?php /* Translators: HTML arrow */ ?>
|
||||
<div class="nav-next"><?php previous_posts_link( sprintf( __( 'newer %s', gV('slug') ), '<span class="meta-nav">→</span>' ) ); ?></div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
</main>
|
Reference in New Issue
Block a user