first theme commit
This commit is contained in:
58
home.php
Normal file
58
home.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Index template.
|
||||
*
|
||||
* @package ThemeStarter
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<!-- Get Header -->
|
||||
<?php get_header(); ?>
|
||||
|
||||
<!-- Index/Fall Back Template -->
|
||||
<?php get_template_part('template-parts/partials/page-header') ?>
|
||||
|
||||
<!-- Single Post/Page Fallback Template -->
|
||||
<section>
|
||||
|
||||
<div class="max-w-7xl grid md:grid-cols-2 lg:grid-cols-4 gap-8 mx-auto px-4 2xl:px-0 py-8">
|
||||
<div class="order-last lg:order-first bg-stone-200 rounded-md">
|
||||
<div class="sticky top-28 p-4 list-none">
|
||||
<?php wp_list_categories(
|
||||
[
|
||||
'title_li' => '<h3 class="font-medium underline mb-2">' . __('Categories', 'ThemeStarter') . '</h3>',
|
||||
]
|
||||
) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (have_posts()) : ?>
|
||||
<div class="grid grid-cols-2 lg:grid-cols-3 col-span-3 gap-4">
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<div>
|
||||
<div class="mb-4">
|
||||
<a href="<?php the_permalink() ?>">
|
||||
<img class="rounded-md overflow-hidden" src="<?= get_the_post_thumbnail_url(get_the_ID(), 'full') ?>" alt="Post Featured Image">
|
||||
</div>
|
||||
</a>
|
||||
<h1 class="text-lg font-bold mb-2"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
|
||||
</div>
|
||||
<?php
|
||||
endwhile;
|
||||
else :
|
||||
_e('Sorry, no posts matched your criteria.', 'textdomain');
|
||||
endif; ?>
|
||||
<div class="text-center font-medium px-6 py-2 col-span-2 lg:col-span-3">
|
||||
<?php posts_nav_link(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Get Footer -->
|
||||
<?php get_footer(); ?>
|
Reference in New Issue
Block a user