forked from rememberlenny/WooThemes-Canvas-Foundation-Zombie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-sitemap.php
101 lines (77 loc) · 3.68 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
99
100
101
<?php
/**
* Template Name: Sitemap
*
* The sitemap page template displays a user-friendly overview
* of the content of your website.
*
* @package WooFramework
* @subpackage Template
*/
global $woo_options;
get_header();
?>
<!-- #content Starts -->
<?php woo_content_before(); ?>
<div id="content" class="row">
<div id="main-sidebar-container">
<!-- #main Starts -->
<?php woo_main_before(); ?>
<div id="main">
<?php woo_loop_before(); ?>
<!-- Post Starts -->
<?php woo_post_before(); ?>
<div class="post">
<?php woo_post_inside_before(); ?>
<h1 class="title"><?php the_title(); ?></h1>
<div class="entry">
<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 $saved = $wp_query;
$cats = get_categories();
foreach ($cats as $cat) {
query_posts('cat='.$cat->cat_ID);
?>
<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>
<?php } $wp_query = $saved; ?>
<?php if ( is_woocommerce_activated() ): ?>
<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>
<?php endif; ?>
</div><!-- /.entry -->
<?php woo_post_inside_after(); ?>
</div><!-- /.post -->
<?php woo_post_after(); ?>
<div class="fix"></div>
</div><!-- /#main -->
<?php woo_main_after(); ?>
<?php get_sidebar(); ?>
</div><!-- /#main-sidebar-container -->
<?php get_sidebar( 'alt' ); ?>
</div><!-- /#content -->
<?php woo_content_after(); ?>
<?php get_footer(); ?>