Codex tools: Log in / create account
Contents |
Returns the correct url for a given Category ID.
<?php get_category_link( $category_id ); ?>
<?php
// Get the ID of a given category
$category_id = get_cat_ID( 'Category Name' );
// Get the URL of this category
$category_link = get_category_link( $category_id );
?>
<!-- Print a link to this category -->
<a href="<?php echo $category_link; ?>" title="Category Name">Category Name</a>
Since: 1.0.0
get_category_link() is located in wp-includes/category-template.php.
the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, get_the_category, get_category_parents, get_category_link, is_category, in_category