/
template-sitemap.php
98 lines (65 loc) · 2.8 KB
/
template-sitemap.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
<?php
/*
Template Name: Sitemap
*/
?>
<?php get_header(); ?>
<div class="row visible">
<?php if ( $woo_options[ 'woo_breadcrumbs_show' ] == 'true' ) { ?>
<?php woo_breadcrumbs(); ?>
<?php } ?>
<section id="content" role="content">
<div <?php post_class(); ?>>
<h1 class="title"><?php the_title(); ?></h1>
<div class="col2-set">
<?php if (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
<div class="col-1">
<h3><?php _e( 'Pages', 'woothemes' ) ?></h3>
<ul>
<?php wp_list_pages( 'depth=0&sort_column=menu_order&title_li=' ); ?>
</ul>
<h3><?php _e( 'Categories', 'woothemes' ) ?></h3>
<ul>
<?php wp_list_categories( 'title_li=&hierarchical=0&show_count=1') ?>
</ul>
<h3><?php _e( 'Posts per category', 'woothemes' ); ?></h3>
<?php
$cats = get_categories();
foreach ($cats as $cat) {
query_posts( 'cat='.$cat->cat_ID);
?>
<?php } ?>
<h4><?php echo $cat->cat_name; ?></h4>
<ul>
<?php while (have_posts()) : the_post(); ?>
<li style="font-weight:normal !important;"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> - <?php _e( 'Comments', 'woothemes' ) ?> (<?php echo $post->comment_count ?>)</li>
<?php endwhile; ?>
</ul>
</div>
<div class="col-2">
<h3><?php _e( 'Product Categories', 'woothemes' ) ?></h3>
<ul>
<?php
wp_list_categories( 'taxonomy=product_cat&pad_counts=1&title_li=' );
?>
</ul>
<h3><?php _e( 'Products', 'woothemes' ); ?></h3>
<ul>
<?php
$args = array( 'post_type' => 'product', 'posts_per_page' => 100 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>
</div>
<div class="fix"></div>
</div><!-- /.entry -->
</div><!-- /.post -->
</section><!-- /#content -->
<?php get_sidebar(); ?>
</div><!-- /.row -->
<?php get_footer(); ?>