-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
37 lines (29 loc) · 1.26 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
get_header();
?>
<div class="mx-auto max-w-7xl px-6 lg:px-8">
<div class="mx-auto max-w-2xl lg:max-w-4xl">
<div class="mt-16 space-y-20 lg:mt-20 lg:space-y-20">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// Query the latest posts
$args = array(
'posts_per_page' => 3, // Adjust the number of posts to display //TODO: let user chose this number and also set it on the customizer and reading settings page of admin dashboard
'paged' => $paged, // Add pagination support
);
$posts = new WP_Query($args);
// Loop through the latest posts
while ($posts->have_posts()) : $posts->the_post();
get_template_part(Wpstorm_Templates::get_post_list_template());
endwhile;
// Add pagination links
get_template_part(Wpstorm_Templates::get_paginate_template());
wp_reset_postdata();
// Reset the main query to its original state
wp_reset_query();
?>
</div>
</div>
</div>
<?php
get_footer();