WordPress gets the category link tag according to the category ID: get_ category_ link

WordPress template tag get_ category_ Link returns the fixed link of the corresponding category according to the category ID passed, which is also commonly used in WordPress theme development.

get_category_link( integer $category )

Function parameters

$category

Integer type, default value: None

You must specify a category ID to return a link to the corresponding category

Examples of function usage

<?php get_category_link( 6 ); ?>

Extended reading

get_ category_ The link() function 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_ category_ parents()
  • get_ the_ category()
  • in_ category()
Related Article
WordPress comment date tag: comment_date

WordPress template tags comment_ Date is used to output the date of a comment, usually in a custom comment template. Read more

WordPress comment summary tag: comment_excerpt

WordPress template tags comment_ Excerpt is used to output the summary of comments. The default output is 20 characters. It Read more

WordPress comment time tag: comment_time

WordPress template tags comment_ Time is used to output the publishing time of the current comment, which is the same Read more

WordPress RSS format comment author name tag: comment_author_rss

WordPress template tags comment_ author_ RSS is used to output the comment author name in RSS format, which has no Read more

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image