Skip to content

Instantly share code, notes, and snippets.

@keirwhitaker
Created August 18, 2012 06:51
Show Gist options
  • Save keirwhitaker/3384986 to your computer and use it in GitHub Desktop.
Save keirwhitaker/3384986 to your computer and use it in GitHub Desktop.
Category Page
<?php
/**
* Template Name: Category Page
*/
get_template_part('parts/shared/html-header');
get_template_part('parts/shared/header');
$args = array(
'type' => 'post',
'child_of' => 0,
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'pad_counts' => false );
$categories = get_categories($args);
$post_count = wp_count_posts()->publish;
?>
<section class="primary group archive">
<article>
<?php foreach($categories as $category): ?>
<h2><a href="<?php echo get_category_link($category->cat_ID); ?>" rel="tag"><?php echo $category->cat_name; ?></a></h2>
<?php endforeach; ?>
</article>
</section>
<section class="secondary group">
<?php
get_template_part('parts/shared/ad');
get_template_part('parts/shared/about');
get_template_part('parts/shared/social-links');
get_template_part('parts/shared/blog-categories');
get_template_part('parts/shared/projects');
?>
</section>
<?php
get_template_part('parts/shared/footer');
get_template_part('parts/shared/html-footer');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment