WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Custom Post Archives

Custom Post Archives creates a fully featured set of archives for each post type using a robust back-end and native templating functionality.

How do I format the newly created Archives?

This plugin implements an extension of the WordPress templating framework. In descending order, each custom archive will look for these files in your template directory:

  • tag-{post-type}.php (Only if is_tag())
  • date-{post-type}.php (Only if is_date())
  • author-{post-type}.php (Only if is_author())
  • category-{post-type}.php (Only if is_category())
  • archive-{post-type}.php (Only if is_custom_archive({post-type}))
  • archive-custom.php (Only if is_custom_archive())
  • archive.php
  • index.php

In each of the above examples, {post-type} is replaced by the custom post type name, or an alphabetically sorted list of post types separated by a _, for archives where multiple post types are shown.

Custom Post Archives does not actually create any new files in your template directory, but it will use the archive.php file by default.

How can I format the page title on the custom archive page?

Custom Post Archives implements the wp_title filter to format the page title. If you'd like to change that formatting you can place a variation of the following code into your functions.php file in your template directory.

If there are any other issues, feel free to send a message, or hit the forums.

<?php
// Format Page title for custom archives
function custom_archive_wp_title($title, $sep, $seplocation)
{
    if(!is_custom_archive()) return $title;
    
    $label = get_custom_archive_label();
    
    if($label)
        $title = ($seplocation == 'right')
            ? "$label $sep "
            : " $sep $label";
    
    return $title;
}
add_filter('wp_title','custom_archive_wp_title',10,3);
?>

Requires: 3.0 or higher
Compatible up to: 3.1.4
Last Updated: 2010-12-1
Downloads: 5,795

Ratings

3 stars
3.9 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

0,1,0
100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
80,5,4
100,1,1 100,1,1
100,1,1
100,2,2
100,1,1