forked from gramophone-wp/Gramophone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
108 lines (88 loc) · 3.86 KB
/
home.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/**
*******************************************************************************
* //home.php
*******************************************************************************
*
* The blog posts.
*
* CODEX REF
* https://developer.wordpress.org/themes/basics/template-hierarchy/#home-page-display
*
* @author
* @copyright
* @link
* @todo
* @license
* @since
* @version
**/
?>
<?php get_header(); ?>
<div class="jumbotron jumbotron-fluid">
<div class="container">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<h1>Page <?php echo $paged; ?></h1>
</div>
</div>
<div class="container">
<div class="container" id="display">
<div class="hidden-xs-down col-sm-12">
<div class="float-right">
<strong>Display</strong>
<div class="btn-group">
<a href="#" id="grid" class="btn btn-default btn-sm"><span class="fa fa-square"></span> Grid</a>
<a href="#" id="list" class="btn btn-default btn-sm"><span class="fa fa-list"></span> List</a>
</div>
</div>
</div>
</div>
<div class="container">
<div id="posts" class="list-group">
<div class="row">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="item col-12 col-md-6 col-lg-4 <?php if (isset($_COOKIE['display-type']) && 'list' === $_COOKIE['display-type']) echo 'col-lg-12'; ?>" id="post-<?php the_ID(); ?>">
<div class="card">
<a href="<?php the_permalink(); ?>">
<img class="group list-group-image <?php if (isset($_COOKIE['display-type']) && 'list' === $_COOKIE['display-type']) echo 'hidden'; ?>" src="<?php echo get_the_post_thumbnail_url() ? get_the_post_thumbnail_url() : get_template_directory_uri() . '/static/images/logos/gramophone_placeholder.png'; ?>" alt="" id="post-image" />
</a>
<div <?php post_class(); ?>>
<div class="card-block">
<?php if( get_the_title() ): ?>
<h4 class="card-title"><a href="<?php the_permalink(); ?>" class="post-title"><?php the_title(); ?></a></h4>
<?php else: ?>
<h4 class="card-title"><a href="<?php the_permalink(); ?>">READ MORE</a></h4>
<?php endif; ?>
<div class="post-metadata <?php if (isset($_COOKIE['display-type']) && 'grid' === $_COOKIE['display-type']) echo 'hidden'; ?>">
<p>
By <?php the_author_posts_link(); ?>
<span class="hidden-xs-down">
on <?php echo the_time('l, F jS, Y');?>
</span>
in <?php the_category( ', ' ); ?>.
<span class="pull-right hidden-sm-down">
<a href="<?php comments_link(); ?>">
<?php comments_number(); ?>
</a>
</span>
</p>
</div>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>" class="btn btn-primary">View Article</a>
</div>
</div>
</div>
</article>
<?php endwhile; else: ?>
</div>
<div class="page-header">
<h1>No posts as yet.</h1>
</div>
<p>No content is appearing for this page!</p>
<?php endif; ?>
</div>
</div>
<?php theme_pagination(); ?>
</div>
</div>
<?php get_footer(); ?>