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.

Fun with Categories

Description

This plugin allows you to display posts that appear in both of the two specified categories.
It will display these posts on a custom page in your template called categories.php (if you produce one) or your archive.php page, failing that it will fallback to index.php.
Once installed you also have available two additional theme tags:

<?php is_dual_categories(); ?> 

This returns true or false to determine if the posts are being filtered by two categories.

<?php dual_cat_titles(); ?>

This is the dual category equivalent to single_cat_title() used on the archive page. By default this outputs both category names with �and� between them.

There are two options:

  1. Specify Which category:

show the first (1) , second (2), or both (0) categories:

<?php dual_cat_titles( 1 ); ?>
  1. Specify what appears between them:

If showing both categories choose the text to go between them (including spaces):

<?php dual_cat_titles( 0 , ' and '); ?>

An example of its use:

The URL reads: http://www.mysite.com/index.php/categores/india/photographs/

The code reads:

<strong><?php dual_cat_titles( 2 ); ?> from <?php dual_cat_titles( 1 ); ?></strong>

The page displays: Photographs from India

Changing the dual category base

From WordPress 2.7 this plugin adds a new field to the permalink settings page to set the dual category base. So if you want to /country/india/photo/ enter country in the dual category base.

Installation

Unzip the plugin into your plugins directory as normal and activate. There are no plugin settings.

If you want to produce a template page specifically for posts filtered by two categories you should call your template page categories.php.

It will default to your archive.php file, and then to the index file if not found.

Contributors & Developers

“Fun with Categories” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Fun with Categories” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.