forked from MITLibraries/MITLibraries-news
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcategory.php
95 lines (75 loc) · 2.34 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
<?php
/**
* The template for displaying Category pages.
*
* Used to display archive-type pages for posts in a category.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header();
$date = DateTime::createFromFormat('Ymd', get_field('event_date'));
?>
<?php get_template_part('inc/sub-header'); ?>
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<div class="container container-fluid">
<div class="row">
<?php
if(is_category()){
printf('<h1 class="lib-header">'. 'Category: ' . '<strong>' . single_cat_title( '', false ) . '</strong>' . '</h1>' );
} ?>
<?php
/* Start the Loop */
$i = -1;
while ( have_posts() ) : the_post();
$i++;
renderRegularCard( $i, $post ); // --- CALLS REGULAR CARDS --- //
?>
<?php if ( get_post_type( get_the_ID() ) == 'bibliotech' ) { ?>
<?php } //get_post_type( get_the_ID() ) == 'bibliotech' ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<!--closes ROW-->
</div>
<!--closes NEWS-CONTAINER-->
<?php get_template_part('inc/more-posts'); ?>
</div>
<!-- #content -->
<!-- #primary -->
<script>
<?php
if (is_category( )) {
$cat = get_query_var('cat');
$yourcat = get_category ($cat);
$category2 = get_category_by_slug( $yourcat->slug);
$categoryID2 = $category2->cat_ID;
}
?>
$(document).ready(function() {
var offset = 21;
var limit = 9;
//$("#postContainer").load("/news/add-posts-category/");
$("#another").click(function(){
limit = limit+9;
offset = offset+21;
$("#postContainer")
//.slideUp()
.load("/news/add-posts-category/?offset="+offset+"&limit="+limit+"&categoryID="+<?php echo $categoryID2; ?>+"", function() {
//.load("/news/test/?offset="+offset, function() {
$(this).slideDown();
$('#another').click(function() {
// alert($j(this).load());
});
});
return false;
});
});
</script>
<div class="container">
<?php get_footer(); ?>