-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-cornhole.php
66 lines (58 loc) · 1.63 KB
/
page-cornhole.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* Template Name: Cornhole League
*
* @package WordPress
* @subpackage Superfluous Nomenclature
*
*/
get_header(); ?>
<div class="page-header">
<h1 class="display-3 text-center pg-title text-uppercase">Cornhole League</h1>
</div>
<div class="container">
<main class="main-content-area pt-3 pb-3" style="margin-top:0px;">
<figure class="pb-3">
<?php the_post_thumbnail( 'full', array( 'class' => 'aligncenter shadow mb-3 img-fluid aboutwbw mt-0' ) ); ?>
</figure>
<?php the_content(); ?>
<br />
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'posts_per_page' => 10,
'post_type' => 'cornhole-league',
'paged' => $paged,
);
$loop = new WP_Query( $args );
if ($loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="row">
<div class="col-md-12">
<h2><?php the_title(); ?></h2>
<small>Posted on: <?php echo get_the_date(); ?></small>
<?php the_excerpt(); ?>
</div>
</div>
<hr />
<?php endwhile;
$total_pages = $loop->max_num_pages;
if ($total_pages > 1){
$current_page = max(1, get_query_var('paged'));
echo paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => '/page/%#%',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => __('« prev'),
'next_text' => __('next »'),
));
}}
wp_reset_postdata(); ?>
</main>
<div class="col-md-12 pt-3 pb-3 beer-tags shadow">
<?php the_tags('<span class="badge badge-secondary"><i class="fas fa-tags"></i> Related:</span> ', ', '); ?>
</div>
</div>
<?php get_footer(); ?>