-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcategory.php
executable file
·94 lines (76 loc) · 2.53 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
<?php
/*
Template Name: Category
*/
?>
<?php get_header(); ?>
<section id="main_section">
<section id="games_intro" class="grey_plate">
<form class="search category"method="get" action="<?php bloginfo('url'); ?>/">
<label for="s">Search: </label>
<?php
$parentCatList = get_category_parents($cat,false,',');
$parentCatListArray = split(",",$parentCatList);
$topParentName = $parentCatListArray[0];
$topParentID = get_cat_ID(strtolower($topParentName));
$args = array(
'child_of' => $topParentID,
'hierarchical' => true,
'depth' => 4,
'show_option_all' => "All " . $topParentName
);
wp_dropdown_categories($args);
?>
<input type="text" id="s" name="s" class="ss-form-entry ss-q-short search_entry" title="ENTER YOUR SEARCH HERE"value="<?php the_search_query(); ?>">
<input type="submit" class="ss-q-submit" value="OK!">
</form>
<?php
echo get_category_parents($cat, TRUE, ' » ') . "<br/>";
if (is_category()){
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<ul>";
wp_list_categories('orderby=id&show_count=0&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
}
?>
</section><!-- #games_intro -->
<section id="feature_spots">
<?php
$count = 1;
$loop = new WP_Query(array(
'post_type'=> array('resource','game',),
//'category_name'=>single_cat_title('', false)
'cat' => $this_category->cat_ID
));
if ($loop->have_posts()) : while ( $loop->have_posts() ) : $loop->the_post();
if($count%3==0){
?>
<article <?php post_class('featured_article last'); ?> >
<?php }else{ ?>
<article <?php post_class('featured_article'); ?> >
<?php } ?>
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail('featured'); ?>
</a>
<div class="featured_article_text">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title( '<h3>', '</h3>' ); ?>
</a>
<p>
<?php
$short_description->the_meta();
$short_description->the_field('description');
$short_description->the_value();
?>
</p>
</div>
</article>
<?php $count ++;?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</section><!-- feature_spots -->
</section><!-- main_section -->
<?php get_footer(); ?>