WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get category template

Description

Retrieve path of category template in current or parent template.

Works by retrieving the current category ID, for example 'category-1.php' and will fallback to category.php template, if the category ID file doesn't exist.

Usage

<?php get_category_template() ?>

Parameters

None.

Return Values

(string) 
Returns path of category template in current or parent template.

Examples

Notes

Filters

  • Calls 'category_template' filter on found path:
    apply_filters('category_template', $template)

Change Log

Since: 1.5.0

Source File

get_category_template() is located in wp-includes/template.php.

Related

https://codex.wordpress.org/Plugin_API/Filter_Reference/category_template

See also index of Function Reference and index of Template Tags.