slowtwitch-news/single.php

94 lines
4.2 KiB
PHP
Raw Permalink Normal View History

2024-07-02 20:45:52 +00:00
<?php get_header() ?>
2024-07-23 21:31:45 +00:00
<div class="st-article-section-topper"></div>
2024-08-14 20:47:52 +00:00
<main class="st-main-grid">
<section class="st-article-section-grid st-article-section-grid__article-page">
<article class="st-article">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
$post_id = get_the_ID();
?>
<h1 class="st-article__title"> <?php the_title(); ?> </h1>
2024-08-20 17:11:17 +00:00
<a href="<?php echo get_author_posts_url($post->post_author); ?>" class="st-article-page__author-link">
2024-08-16 16:15:54 +00:00
<div class="st-article__author-box">
<div class="st-article__author-name">
<?php the_author() ?>
</div>
<div>
<?php the_date() ?>
</div>
2024-08-14 20:47:52 +00:00
</div>
2024-08-16 16:15:54 +00:00
</a>
2024-08-14 20:47:52 +00:00
<?php the_content(); ?>
2024-08-20 17:11:17 +00:00
<?php
$tags = get_the_tags();
if ($tags) {
2024-08-20 18:08:18 +00:00
?><h4>Tags:</h4><?php
2024-08-20 17:11:17 +00:00
foreach ($tags as $tag) {
echo '<a class="st-chip st-chip-primary st-chip-tag-cloud" href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>';
}
}
?>
2024-08-14 20:47:52 +00:00
<?php
if (function_exists('get_field')) {
$related_posts = get_field('related_posts', $post_id);
if (isset($related_posts) && is_array($related_posts)) : ?>
2024-08-20 21:21:39 +00:00
<div class="st-sub-grid">
2024-08-14 20:47:52 +00:00
<h3>Related Articles</h3>
<div class="st-article-section-related-articles">
<?php foreach ($related_posts as $post) : setup_postdata($post);
$category = get_the_category()[0]; ?>
<article class="st-related-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-sub-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<div class="st-article-section-sub-article__text-container">
<a href="<?php echo home_url($category->slug); ?>" class="st-article-section-sub-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-sub-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
</div>
</a>
</article>
<?php endforeach;
wp_reset_postdata(); ?>
</div>
</div>
<?php
endif;
}
}
} ?>
2024-09-11 18:45:42 +00:00
<?php
comments_template();
?>
2024-08-14 20:47:52 +00:00
</article>
<section class="st-ad-section st-ad-section__article-page">
<?php
2024-09-11 19:00:24 +00:00
if ( function_exists('the_ad_placement') ) {
the_ad_placement('ads-small-a');
the_ad_placement('ads-small-b');
2024-07-02 20:45:52 +00:00
}
2024-08-21 17:06:51 +00:00
if (function_exists('dynamic_sidebar')) {
dynamic_sidebar('mailing_list');
}
2024-08-14 20:47:52 +00:00
?>
</section>
</section>
<section class="st-article-section-grid st-article-section-grid__article-page">
2024-08-20 17:11:17 +00:00
2024-08-14 20:47:52 +00:00
<section class="st-ad-section-long-post-end st-article">
<?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
}
2024-08-14 20:47:52 +00:00
?>
</section>
2024-09-11 18:45:42 +00:00
2024-07-29 17:03:13 +00:00
</section>
2024-08-14 20:47:52 +00:00
</main>
<?php
get_footer();
2024-07-22 19:41:07 +00:00
?>