Advertisement
kingBethal

All posts archive page

Feb 10th, 2021
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying archive pages
  4.  *
  5.  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6.  *
  7.  */
  8. get_header();
  9. ?>
  10.  
  11. <div id="primary" class="content-area">
  12.     <main id="main" class="site-main" role="main">
  13.  
  14.  
  15.         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  16.  
  17.                 <!-- custom template to show a single post title, author -->
  18.                 <div class="post-title">
  19.                     <a href="<?php echo esc_url(get_permalink()); ?>">
  20.                         <h4 class="text-title">
  21.                             <?php the_title(); ?>
  22.                         </h4>
  23.                     </a>
  24.                     <span>Post by <?php echo the_author_meta('display_name'); ?></span>
  25.                 </div>
  26.  
  27.                 <?php
  28.             endwhile; // end loop
  29.             wp_reset_postdata(); // reset query
  30.         else :
  31.             get_template_part('template-parts/content', 'search-none');
  32.  
  33.         endif;
  34.         ?>
  35.  
  36. </div>
  37. </main><!-- #main -->
  38. </div>
  39. <?php
  40. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement