slowtwitch-wp-theme/front-page.php

131 lines
4.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php get_header() ?>
<!-- Primary Page Layout
-->
<?php
query_posts('showposts=1');
if (have_posts()) : while (have_posts()) : the_post();
$category = get_the_category()[0];
?>
<div style="text-align: center;" class="container front-page-most-recent-post">
<div class="row">
<div class="one-third column">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
<div class="two-thirds column">
<a href="<?php echo home_url($category->slug) ?>">
<p><?php echo $category->name; ?></p>
</a>
<a style="text-decoration: none; color: black;" href="<?php the_permalink(); ?>">
<h4><?php the_title(); ?></h4>
</a>
<p class="front-page-most-recent-post-excerpt"><?php the_excerpt(__('(more…)')); ?></p>
<span class="datetime"><?php the_time('F j, Y'); ?></span> -
<?php the_author_posts_link(); ?>
</a>
</div>
</div>
</div>
<?php
endwhile;
endif;
wp_reset_postdata();
$post_section_two_args = array(
'showposts' => 6,
'offset' => 1,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?>
<div style="text-align: center;" class="container front-page-post-grid">
<div class="column two-thirds container front-page-post-grid-card-container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$category = get_the_category()[0];
?>
<div class="front-page-post-grid-card">
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>">
</a>
<a href="<?php echo home_url($category->slug) ?>">
<p><?php echo $category->name; ?></p>
</a>
<a style="text-decoration: none; color: black;" href="<?php the_permalink(); ?>">
<h6><?php the_title(); ?></h6>
</a>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
<div class="column one-third">
<img class="front-page-article-grid-ad-mock" src="/wp-content/themes/slowtwitch-wp/assets/images/vertical-ad-mock.jpg" alt="">
</div>
</div>
<div class="container">
<hr class="slowtwitch-divider">
</div>
<div class="container">
<div class="row">
<img class="slowtwitch-horizontal-ad" src="/wp-content/themes/slowtwitch-wp/assets/images/ad-mock.jpg" alt="ad mock">
</div>
</div>
<div class="container">
<hr class="slowtwitch-divider">
</div>
<?php
$post_section_two_args = array(
'showposts' => 8,
'offset' => 7,
'orderby' => 'post_date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish'
);
query_posts($post_section_two_args);
?>
<div style="text-align: center;" class="container front-page-post-grid">
<div class="column two-thirds container front-page-post-grid-card-container">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$category = get_the_category()[0];
?>
<div class="front-page-post-grid-card">
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>">
</a>
<a href="<?php echo home_url($category->slug) ?>">
<p><?php echo $category->name; ?></p>
</a>
<a style="text-decoration: none; color: black;" href="<?php the_permalink(); ?>">
<h6><?php the_title(); ?></h6>
</a>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</div>
<div class="column one-third">
<?php dynamic_sidebar('slowtwitch-front-page'); ?>
</div>
</div>
<?php get_footer() ?>