slowtwitch-news/front-page.php

422 lines
23 KiB
PHP
Raw Permalink Normal View History

2024-07-01 20:18:30 +00:00
<?php get_header() ?>
<main class="st-main st-main-grid">
<!-- LATEST SECTION -->
2024-08-21 17:06:51 +00:00
<div class="st-article-section-topper"></div>
2024-07-01 20:18:30 +00:00
<section class="st-article-section-grid">
<section class="st-article-section st-article-section-highlight">
<h2 class="st-article-section-title"><a href="<?php echo home_url() . '/articles/'; ?>" class="st-article-section-category-link">Latest</a> <a href="<?php echo home_url() . '/articles/'; ?>" class="st-article-section-category-link">></a></h2>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
query_posts('showposts=1');
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
2024-08-21 17:06:51 +00:00
$author = get_userdata($post->post_author);
2024-07-01 20:18:30 +00:00
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-main-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-main-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php echo home_url($category->slug); ?>" class="st-article-section-main-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-main-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
<p class="st-article-section-main-article__excerpt"><?php echo get_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>
</article>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
endwhile;
2024-07-01 20:18:30 +00:00
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
$post_section_two_args = array(
'showposts' => 5,
'offset' => 1,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?><div class="st-article-section-sub-article-stack"><?php
2024-08-21 17:06:51 +00:00
if (have_posts()) : while (have_posts()) : the_post();
$category = get_the_category()[0];
$author = get_userdata($post->post_author);
?>
<article class="st-article-section-sub-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
endwhile;
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
?>
</div>
</section>
<section class="st-ad-section st-ad-section__top">
2024-08-21 17:06:51 +00:00
<?php
2024-09-11 19:00:24 +00:00
if ( function_exists('the_ad_placement') ) {
the_ad_placement('ads-tall');
the_ad_placement('ads-small-a');
the_ad_placement('ads-small-b');
2024-08-21 17:06:51 +00:00
}
if (function_exists('dynamic_sidebar')) {
dynamic_sidebar('mailing_list');
}
?>
2024-07-01 20:18:30 +00:00
</section>
<!-- TECH SECTION -->
<section class="st-article-section st-article-section-bottom">
2024-07-09 20:33:05 +00:00
<?php
2024-08-12 20:58:07 +00:00
$section_category = 'News';
2024-08-21 17:06:51 +00:00
$section_category_id = get_cat_ID($section_category);
2024-07-09 20:33:05 +00:00
?>
<h2 class="st-article-section-title"><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link"><?php echo $section_category; ?></a> <a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link">></a></h2>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
$post_section_three_featured_args = array(
'showposts' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_three_featured_args);
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
2024-08-21 17:06:51 +00:00
$author = get_userdata($post->post_author);
2024-07-01 20:18:30 +00:00
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-main-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-main-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php echo home_url($category->slug); ?>" class="st-article-section-main-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-main-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
<p class="st-article-section-main-article__excerpt"><?php echo get_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>
</article>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
endwhile;
2024-07-01 20:18:30 +00:00
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
$post_section_two_args = array(
'showposts' => 5,
'offset' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?><div class="st-article-section-sub-article-stack"><?php
2024-08-21 17:06:51 +00:00
if (have_posts()) : while (have_posts()) : the_post();
$category = get_the_category()[0];
$author = get_userdata($post->post_author);
?>
<article class="st-article-section-sub-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
endwhile;
endif;
wp_reset_postdata();
wp_reset_query();
?>
2024-07-01 20:18:30 +00:00
</div>
</section>
</section>
<!-- FLAT HORIZONTAL SECTION HERE -->
<section class="st-article-section st-article-section-wide">
<?php
2024-08-21 17:06:51 +00:00
$section_category = 'Cycling';
$section_category_id = get_cat_ID($section_category);
2024-07-09 20:33:05 +00:00
?>
<h2 class="st-article-section-title"><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link"><?php echo $section_category; ?></a><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link">></a></h2>
2024-07-09 20:33:05 +00:00
<?php
2024-08-21 17:06:51 +00:00
$post_section_three_featured_args = array(
'showposts' => 4,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_three_featured_args);
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-wide-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>
2024-07-01 20:18:30 +00:00
<?php
endwhile;
2024-08-21 17:06:51 +00:00
endif;
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
?>
</section>
2024-07-26 18:02:52 +00:00
<section class="st-ad-section-long">
<?php
2024-09-11 19:00:24 +00:00
if( function_exists('the_ad_placement') ) {
the_ad_placement('ads-long');
2024-08-21 17:06:51 +00:00
}
2024-07-26 18:02:52 +00:00
?>
</section>
2024-07-01 20:18:30 +00:00
<!-- LATEST SECTION -->
<section class="st-article-section-grid">
<section class="st-article-section st-article-section-highlight">
<?php
2024-08-21 17:06:51 +00:00
$section_category = 'Industry';
$section_category_id = get_cat_ID($section_category);
2024-07-09 20:33:05 +00:00
?>
<h2 class="st-article-section-title"><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link"><?php echo $section_category; ?></a> <a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link">></a></h2>
2024-07-09 20:33:05 +00:00
<?php
2024-08-21 17:06:51 +00:00
$post_section_three_featured_args = array(
'showposts' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_three_featured_args);
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
2024-08-21 17:06:51 +00:00
$author = get_userdata($post->post_author);
2024-07-01 20:18:30 +00:00
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-main-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-main-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php echo home_url($category->slug); ?>" class="st-article-section-main-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-main-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
<p class="st-article-section-main-article__excerpt"><?php echo get_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>
</article>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
endwhile;
2024-07-01 20:18:30 +00:00
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
$post_section_two_args = array(
'showposts' => 5,
'offset' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?><div class="st-article-section-sub-article-stack"><?php
2024-08-21 17:06:51 +00:00
if (have_posts()) : while (have_posts()) : the_post();
$category = get_the_category()[0];
$author = get_userdata($post->post_author);
?>
<article class="st-article-section-sub-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
endwhile;
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
?>
</div>
</section>
<section class="st-ad-section st-ad-section__top">
2024-08-21 17:06:51 +00:00
<?php
2024-09-11 19:00:24 +00:00
if ( function_exists('the_ad_placement') ) {
the_ad_placement('ads-tall');
the_ad_placement('ads-small-a');
the_ad_placement('ads-small-b');
2024-08-21 17:06:51 +00:00
}
if (function_exists('dynamic_sidebar')) {
dynamic_sidebar('mailing_list');
}
?>
2024-07-01 20:18:30 +00:00
</section>
2024-08-21 17:06:51 +00:00
2024-07-01 20:18:30 +00:00
<section class="st-article-section st-article-section-bottom">
2024-08-21 17:06:51 +00:00
<?php
$section_category = 'Running';
$section_category_id = get_cat_ID($section_category);
2024-07-09 20:33:05 +00:00
?>
<h2 class="st-article-section-title"><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link"><?php echo $section_category; ?></a> <a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link">></a></h2>
2024-07-09 20:33:05 +00:00
<?php
2024-08-21 17:06:51 +00:00
$post_section_three_featured_args = array(
'showposts' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_three_featured_args);
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
2024-08-21 17:06:51 +00:00
$author = get_userdata($post->post_author);
2024-07-01 20:18:30 +00:00
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-main-article">
<a href="<?php the_permalink(); ?>" class="st-article-section-main-article__image-link">
<?php the_post_thumbnail(); ?>
</a>
<a href="<?php echo home_url($category->slug); ?>" class="st-article-section-main-article__category-link"><?php echo $category->name; ?></a>
<a class="st-article-section-main-article__title" href="<?php the_permalink(); ?>">
<h3><?php the_title(); ?></h3>
</a>
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
<p class="st-article-section-main-article__excerpt"><?php echo get_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>
</article>
2024-07-01 20:18:30 +00:00
<?php
2024-08-21 17:06:51 +00:00
endwhile;
2024-07-01 20:18:30 +00:00
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
$post_section_two_args = array(
'showposts' => 5,
'offset' => 1,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?><div class="st-article-section-sub-article-stack"><?php
2024-08-21 17:06:51 +00:00
if (have_posts()) : while (have_posts()) : the_post();
$category = get_the_category()[0];
$author = get_userdata($post->post_author);
?>
<article class="st-article-section-sub-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
endwhile;
endif;
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
?>
</div>
</section>
<section class="st-newsletter-signup">
<!-- MORE STUFF HERE -->
</section>
</section>
<!-- FLAT HORIZONTAL SECTION HERE -->
<section class="st-article-section st-article-section-wide">
<?php
2024-08-21 17:06:51 +00:00
$section_category = 'Training';
$section_category_id = get_cat_ID($section_category);
2024-07-09 20:33:05 +00:00
?>
<h2 class="st-article-section-title"><a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link"><?php echo $section_category; ?></a> <a href="<?php echo get_category_link($section_category_id); ?>" class="st-article-section-category-link">></a></h2>
2024-07-09 20:33:05 +00:00
<?php
2024-08-21 17:06:51 +00:00
$post_section_three_featured_args = array(
'showposts' => 4,
'category_name' => $section_category,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_three_featured_args);
if (have_posts()) : while (have_posts()) : the_post();
2024-07-01 20:18:30 +00:00
$category = get_the_category()[0];
2024-08-21 17:06:51 +00:00
$author = get_userdata($post->post_author);
2024-07-01 20:18:30 +00:00
?>
2024-08-21 17:06:51 +00:00
<article class="st-article-section-wide-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>
2024-07-01 20:18:30 +00:00
<?php
endwhile;
2024-08-21 17:06:51 +00:00
endif;
2024-07-01 20:18:30 +00:00
2024-08-21 17:06:51 +00:00
wp_reset_postdata();
wp_reset_query();
2024-07-01 20:18:30 +00:00
?>
</section>
</main>
2024-06-20 22:15:11 +00:00
<?php get_footer() ?>