WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/get category link

Description

Returns the correct url for a given Category ID.

This is a category id of blog posts, not links.

Using a nonexistent Category ID will return a link to the parent directory

eg: http://yoursite.com/baseurl/archives/category/

Usage

 <a href=<nowiki>\"<?php echo get_category_link($cat);?>\"</nowiki>>category name</a> 

Parameters

$category_id
(integer) (required) The category ID whose link will be retrieved.
Default: None

Related

See also index of Function Reference and index of Template Tags.
This article is marked as in need of editing. You can help Codex by editing it.