Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php define( 'WP_USE_THEMES', false ); get_header(); ?>
- <?php if ( have_posts() ) : ?>
- <main>
- <div class="archive">
- <div class="col-03"> </div>
- <div class="col-09">
- <h2>
- <?php
- if( is_category() ) {
- single_cat_title(); // This echos out the categoy name
- } elseif ( is_tag() ) {
- single_tag_title(); // This echos out the tag name
- } elseif ( is_author() ) {
- the_post(); echo "Posts by " . get_the_author(); rewind_posts(); // This echos out the author name
- } elseif ( is_day() ) {
- echo "Daily Archives: " . get_the_date(); // This echos out the day
- } elseif ( is_month() ) {
- echo "Monthly Archives: " . get_the_date('F Y'); // This echos out the month and year
- } elseif ( is_year() ) {
- echo "Yearly Archives: " . get_the_date('Y'); // This echos out the year
- }
- else { echo "Archives"; }
- ?>
- </h2>
- <p>
- These are the posts filed under the <?php single_cat_title(); ?> category. You will not be able
- to identify the post content other than the photograph that associates with the post. I've
- decided that adding text to each photo would just be too much.
- </p>
- </div>
- <?php while ( have_posts() ) : the_post(); ?>
- <div class="archive-gallery">
- <?php if ( has_post_thumbnail() ) : ?>
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail(); ?></a>
- <?php endif; ?>
- </div>
- <?php
- endwhile; ?>
- </div>
- </main>
- <?php else :
- esc_html_e( "Sorry. No posts match your criteria." );
- endif; get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement