query_vars['category_name'], 'category' ); if (!empty($theCatID)) $theCatID = $theCatID->term_id; if (isset($wp_query->query_vars['cat'])) $theCatID = (int)$wp_query->query_vars['cat']; } $count = 'No'; $count = $wp_query->found_posts; // $count = $wp_query->post_count; $post = $posts[0]; // Hack. Set $post so that the_date() works $title_string = ''; if (is_category()) { /* Category */ $title_string = __('Archive for ','easel').single_cat_title('',false); } elseif(is_tag()) { /* Tag */ $title_string = __('Posts Tagged ','easel').single_tag_title('',false); } elseif (is_day()) { $title_string = __('Archive for ','easel').get_the_time('F jS, Y'); } elseif (is_month()) { $title_string = __('Archive for ','easel').get_the_time('F, Y'); } elseif (is_year()) { $title_string = __('Archive for ','easel').get_the_time('Y'); } elseif (is_author()) { $title_string = __('Author Archive ','easel').get_the_time('Y'); } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { $title_string = __('Archives','easel'); } elseif (isset($wp_query->query_vars['taxonomy']) && taxonomy_exists($wp_query->query_vars['taxonomy'])) { if (term_exists($wp_query->query_vars['term'])) { $title_string = __('Archive for ','easel').$wp_query->query_vars['term']; } else { $title_string = __('Archive for ','easel').$wp_query->query_vars['taxonomy']; } } elseif ($post->post_type !== 'post') { $title_string = __('Archive for ','easel').$post->post_type; } else { $title_string = __('Archive is unable to be found.','easel'); } if (have_posts()) { ?>