forked from emcconne/surfagility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.php
128 lines (120 loc) · 4.21 KB
/
category.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
* The aategory file
*
*/
get_header(); ?>
<?php
$catID = $wp_query->get_queried_object_id();
$dir = plugin_dir_path( __FILE__ );
$category_image = $dir . "/images/category/" . $catID . ".jpg";
?>
<!-- container div starts in header -->
<!-- row div starts in header -->
<div class="col-lg-5 col-sm-5 cover" >
<?php if ( !file_exists($category_image) ) : ?>
<div class="cover-img" style="background-image:url('<?php bloginfo('template_directory');?>/images/surfagility.jpg')">
<?php else: ?>
<div class="cover-img" style="background-image:url('<?php bloginfo('template_directory');?>/images/category/<?php echo $catID; ?>.jpg')">
<?php endif ?>
<div class="cover-body">
<div class="cover-body-inner">
<h1 class="cover-title">
<?php single_cat_title(); ?>
</h1>
<p class="cover-description">
</p>
<div class="cover-actions">
<?php
$args = array(
'child_of' => $catID
);
$child_categories = get_categories ( $args );
?>
<?php if ( $child_categories ) : ?>
<p class="check-it">
Child Collections:
</p>
<ul>
<?php
$title = '';
$args = array(
'title_li' => $title,
'depth' => 1,
'child_of' => $catID
);
wp_list_categories( $args );
?>
</ul>
<?php endif; ?>
<p class="check-it">
Other Collections:
</p>
<ul>
<?php
$title = '';
$args = array(
'title_li' => $title,
'exclude' => $catID,
'depth' => 1
);
wp_list_categories( $args );
?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-7 col-sm-7 content">
<hr>
<div class="row">
<div class="nav-item pull-left">Latest from <?php single_cat_title(); ?>
<a href="<?php echo get_category_link( $catID ); ?>/feed/"><i class="icon-rss"></i></a>
</div>
<div class="nav-item pull-right">
<?php if ( get_next_posts_link() ) : ?>
<?php echo get_next_posts_link('More <i class="glyphicon glyphicon-chevron-right"></i>') ?>
<?php endif; ?>
</div>
</div>
<?php if ( $child_categories ) : ?>
<div class="category-heirarchy">
<?php echo get_category_parents( $cat, true, ' » ' ); ?>
</div>
<?php endif; ?>
<hr>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<h1 id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h1>
<div class="post-author">
By <?php the_author_posts_link(); ?>
</div>
<div class="post-info">
<span class="post-date small-light-text">
<span class="glyphicon glyphicon-calendar"></span>
<?php the_time('F jS, Y') ?>
</span>
<span class="post-readtime small-light-text">
<span class="glyphicon glyphicon-time"></span>
<?php echo round(wcount() / 250, 0); ?> minute read
</span>
</div>
<div class="post-entry">
<?php custom_excerpt(150, '...More') ?>
</div>
<div class="post-extras">
<?php get_template_part('partials/post', 'metadata'); ?>
</div>
<?php endwhile; ?>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php get_template_part( 'partials/post', 'actions' ); ?>
<!-- row div ends in footer -->
<!-- container div ends in footer -->
<?php get_footer(); ?>