I'm in the midst of modifying a plugin to create a archive page that lists the last 30 days of blog posts, a list of the categories on the blog, and a month by month list of the post dates of the blog with a post count beside each. After some work, I have gotten it to display with Graphene, but it outputs the lists before the page is created and then in the body of the post as well. Can anyone see a problem with the following code which would do this? Note, the tags are not set up fully, but the creation of the data is as shown in the code. I'm after the output or print error here. Blog is running current version of Graphene and Wordpress 3.5.1 Thanks for any thoughts!
<?php
$posts = get_option("archives");
$count_posts = wp_count_posts( 'post' );
$count_pages = wp_count_posts( 'page' );
$count_comments = wp_count_comments();
$count_cats = wp_count_terms( 'category', array( 'hide_empty' => true ) );
$count_tags = wp_count_terms( 'post_tag', array( 'hide_empty' => true ) );
printf( __('This is the archives page of <strong>%1$s</strong>.', 'archives'),
get_bloginfo('name'),
sprintf( _n( '%d post', '%d posts', $count_posts->publish, 'archives' ), number_format_i18n( $count_posts->publish ) ),
sprintf( _n( '%d page', '%d pages', $count_pages->publish, 'archives' ), number_format_i18n( $count_posts->publish ) ),
sprintf( _n( '%d comment', '%d comments', $count_comments->approved, 'archives' ), number_format_i18n( $count_comments->approved ) ),
sprintf( _n( '%d category', '%d categories', $count_cats, 'archives' ), number_format_i18n( $count_cats ) ),
sprintf( _n( '%d tag', '%d tags', $count_tags, 'archives' ), number_format_i18n( $count_tags ) )
);
$tag_cloud = get_terms( 'post_tag' );
if ( $tag_cloud ) :?>
<?php endif; ?>
<h2><?php _e('Last ' .$posts .' Posts', 'archives'); ?></h2>
<?php query_posts('showposts=' .$posts . '\''); ?>
<ul>
<?php
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><?php the_time('F j, Y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> </li>
<?php endwhile; endif; ?>
</ul>
<?php wp_reset_query(); ?>
<h2><?php _e('Categories', 'archives'); ?></h2>
<ul>
<?php wp_list_categories('title_li=&hierarchical=0&show_count=1'); ?>
</ul>
<h2><?php _e('Monthly Archives', 'archives'); ?></h2>
<ul><?php wp_get_archives('type=monthly&show_post_count=1'); ?>
</ul>
<!-- End Archives Plugin-->