Title: Elevate Parent Category Template
Author: echoz
Published: <strong>August 3, 2008</strong>
Last modified: March 14, 2011

---

Search plugins

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/elevate-parent-category-template.svg)

# Elevate Parent Category Template

 By [echoz](https://profiles.wordpress.org/echoz/)

[Download](https://downloads.wordpress.org/plugin/elevate-parent-category-template.1.0.4.zip)

 * [Details](https://test.wordpress.org/plugins/elevate-parent-category-template/#description)
 * [Reviews](https://test.wordpress.org/plugins/elevate-parent-category-template/#reviews)
 *  [Installation](https://test.wordpress.org/plugins/elevate-parent-category-template/#installation)
 * [Development](https://test.wordpress.org/plugins/elevate-parent-category-template/#developers)

 [Support](https://wordpress.org/support/plugin/elevate-parent-category-template/)

## Description

This plugin provides functions to retrieve the parent category of any particular
post should it be assigned to a sub category of that parent category.

Using this feature, the plugin is also able to modify the WordPress Loop to redirect
any category page generation to the parent category. This is especially useful when
theme developers want to be able to specify category-x.php templates and have all
related posts, be it those assigned to the category or the sub categories use that
template for page generation.

So for example the current category structure is as follows.

 * Main Category (has category-x.php template)
    - Sub Category 1
    - Sub Category 2

A post is assigned to “Sub Category 2”.

When the post is requested the plugin will automatically detect if it has a parent
category. If so, it will modify the WP variables to set the current category as 
the parent category and add a new variable stating the actual category of the post.
This affects the WordPress Loop to category-x.php template defined for the parent

### Usable Commands for Theme Developers

The PHP commands for theme developers to use are pretty straight forward.

_get\_category\_child()_ returns the current post child category ID.

_is\_parent()_ checks if the current post is at the parent category.

_get\_category\_title($id)_ gets the title of the category that is $id.

_get\_category\_parent()_ returns the current post’s parent category ID.

## Installation

 1. Upload elevate-parent-category-template.php into your plugins folder.
 2. Activate and you’re done.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Elevate Parent Category Template” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ echoz ](https://profiles.wordpress.org/echoz/)

[Translate “Elevate Parent Category Template” into your language.](https://translate.wordpress.org/projects/wp-plugins/elevate-parent-category-template)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/elevate-parent-category-template/),
check out the [SVN repository](https://plugins.svn.wordpress.org/elevate-parent-category-template/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/elevate-parent-category-template/)
by [RSS](https://plugins.trac.wordpress.org/log/elevate-parent-category-template/?limit=100&mode=stop_on_copy&format=rss).

## Meta

 *  Version **1.0.4**
 *  Last updated **15 years ago**
 *  Active installations **30+**
 *  WordPress version ** 2.5 or higher **
 *  Tested up to **3.1.4**
 *  Language
 * [English (US)](https://wordpress.org/plugins/elevate-parent-category-template/)
 * Tags
 * [category](https://test.wordpress.org/plugins/tags/category/)[loop](https://test.wordpress.org/plugins/tags/loop/)
   [template](https://test.wordpress.org/plugins/tags/template/)
 *  [Advanced View](https://test.wordpress.org/plugins/elevate-parent-category-template/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/elevate-parent-category-template/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/elevate-parent-category-template/reviews/)

## Contributors

 *   [ echoz ](https://profiles.wordpress.org/echoz/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/elevate-parent-category-template/)