-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage_a.php
More file actions
38 lines (32 loc) · 988 Bytes
/
Copy pathpage_a.php
File metadata and controls
38 lines (32 loc) · 988 Bytes
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
38
<?php
/*
Template Name: Page A
*/
get_header();
?>
<div class="container">
<h2>Latest Posts</h2>
<div id="post-container">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 3,
'paged' => 1,
);
$ajax_query = new WP_Query($args);
if ($ajax_query->have_posts()) :
while ($ajax_query->have_posts()) : $ajax_query->the_post(); ?>
<div class="single-post">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<p><?php the_excerpt(); ?></p>
</div>
<?php endwhile;
wp_reset_postdata();
endif;
?>
</div>
<div class="carousel-controls">
<button id="prev-btn" data-page="1">Previous</button>
<button id="next-btn" data-page="1">Next</button>
</div>
<?php get_footer(); ?>