Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » Forum Usage » Forum How-To »

Category & Date archives


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Mar 7, 2009, 02:33 PM
Cosmic Comix & Toys
 
1 posts · Mar 2009
Just have a quick question re: the category and date archive pages. Is there a way to add a title to them? (i.e. "January Archives" or [Category] Archives.)

I saw some talk about the catpage plugin but is that the best way?

Thanks!

Andy
  #2  
Old Mar 8, 2009, 05:15 AM
Flynn's Avatar
Flynn
 
3,745 posts · Oct 2008
Munich, Germany
You can put this in index.php after <?php get_header(); ?>


PHP Code:
<?php if ( is_archive() ) { ?>
       <?php $post $posts[0]; // Hack. Set $post so that the_date() works. ?>
       <?php /* If this is a category archive */ if (is_category()) { ?>
        <h2 class="pagetitle">Archive for the <?php single_cat_title(); ?> Category</h2>
       <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
        <h2 class="pagetitle">Posts Tagged <?php single_tag_title(); ?></h2>
       <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
        <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
       <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
        <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
       <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
        <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
      <?php /* If this is an author archive */ } elseif (is_author()) { ?>
        <h2 class="pagetitle">Author Archive</h2>
       <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
        <h2 class="pagetitle">Blog Archives</h2>
       <?php ?>
<?php 
?>

Bookmarks

Tags
archives

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Category &amp;amp; Pages menu Masselyn Page & Category Menu Bars 12 Mar 2, 2010 05:07 PM
Archives Page-How can I add the date before the post title when using "postbypost"? fromtheranks Atahualpa 3 Wordpress theme 8 Jul 25, 2009 09:52 AM
category pages - with just the linked title, author, date of each related post janey73 Atahualpa 3 Wordpress theme 2 Jun 25, 2009 01:11 PM
Category description & category classes shedhed Page & Category Menu Bars 4 Mar 22, 2009 01:25 AM
Categories & Archives format Glottis Excerpts, Read more, Pagination 3 Jan 30, 2009 11:09 AM


All times are GMT -6. The time now is 08:29 AM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.