slowtwitch-news/archive.php

70 lines
3.1 KiB
PHP
Raw Normal View History

2024-07-02 22:01:34 +00:00
<?php get_header() ?>
2024-07-23 21:31:45 +00:00
<div class="st-article-section-topper"></div>
2024-07-02 22:01:34 +00:00
<div class="st-main-grid">
<div class="st-article-archives">
<?php
$count = $wp_the_query->post_count;
2024-07-19 19:53:03 +00:00
$article_number = 0;
2024-07-02 22:01:34 +00:00
custom_breadcrumbs();
if (have_posts()) {
while (have_posts()) {
the_post();
$category = get_the_category()[0];
$count++;
2024-07-19 19:53:03 +00:00
$article_number++;
if ($article_number == 1) {
$author = get_userdata( $post->post_author );
?>
<article class="st-article-archive-article st-article-archive-article-featured">
<a href="<?php the_permalink(); ?>" class="st-article-section-wide-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<div class="st-article-section-wide-article__text-container">
<a href="<?php echo home_url($category->slug); ?>"
class="st-article-section-wide-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-wide-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
<p class="st-article-section-wide-article__excerpt"><?php the_excerpt(); ?></p>
<a href="<?php echo get_author_posts_url( $post->post_author ); ?>" class="st-article-section-main-article__author-link">by <?php echo $author->display_name; ?>, <?php the_time('F j, Y'); ?></a>
</div>
</a>
</article>
<?php
} else {
2024-07-02 22:01:34 +00:00
?>
<article class="st-article-archive-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-wide-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<div class="st-article-section-wide-article__text-container">
<a href="<?php echo home_url($category->slug); ?>"
class="st-article-section-wide-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-wide-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
<p class="st-article-section-wide-article__excerpt"><?php the_excerpt(); ?></p>
</div>
</a>
</article>
<?php
2024-07-19 19:53:03 +00:00
}
2024-07-02 22:01:34 +00:00
}
}
wp_reset_postdata();
?>
2024-07-29 17:03:13 +00:00
2024-07-02 22:01:34 +00:00
</div>
2024-07-29 17:03:13 +00:00
<!-- HERE IS WHERE THE AD WILL GO -->
<section class="st-ad-section-long-archive">
<?php
2024-09-11 19:00:24 +00:00
if( function_exists('the_ad_placement') ) {
the_ad_placement('ads-long');
2024-07-29 17:03:13 +00:00
}
?>
</section>
2024-07-02 22:01:34 +00:00
<?php list_pagination($count); ?>
</div>
<?php get_footer() ?>