Return to Snippet

Revision: 11127
at January 25, 2009 21:25 by kristarella


Updated Code
function add_category_archives() {
	if (is_page('page')) {
		$archive_query = new WP_Query('showposts=1000&category_name=Category');
		if ($archive_query->have_posts()) echo '<h2>Category Posts</h2>';
		$post_count = 1;
		while ($archive_query->have_posts()) {
			$archive_query->the_post();
?>
			<div class="post_box hentry<?php if ($post_count == 1) echo(' top'); ?>">
				<?php thesis_headline_area(); ?>
			</div>

<?php
			$post_count++;
		}
	}
}
add_action('thesis_hook_after_content', 'add_category_archives');

Revision: 11126
at January 25, 2009 19:11 by kristarella


Initial Code
function add_category_archives() {
	if (is_page('page')) {
		$archive_query = new WP_Query('showposts=1000&category_name=Category');
		if ($archive_query->have_posts()) echo '<h2>Category Posts</h2>';
		$post_count = 1;
		while ($sarchive_query->have_posts()) {
			$archive_query->the_post();
?>
			<div class="post_box hentry<?php if ($post_count == 1) echo(' top'); ?>">
				<?php thesis_headline_area(); ?>
			</div>

<?php
			$post_count++;
		}
	}
}
add_action('thesis_hook_after_content', 'add_category_archives');

Initial URL


Initial Description
The function content should work in any theme, it's just wrapped in a function wrapper for insertion into the Thesis theme.

Initial Title
Add category archives to a page (in Thesis)

Initial Tags
wordpress

Initial Language
PHP