Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Linkify Categories

Turn a string, list, or array of category IDs and/or slugs into a list of links to those categories. Includes widget and template tag.

Template Tags

The plugin provides one template tag for use in your theme templates, functions.php, or plugins.


  • <?php c2c_linkify_categories( $categories, $before = '', $after = '', $between = ', ', $before_last = '', $none = '' ) ?> Displays links to each of any number of categories specified via category IDs/slugs


  • $categories A single category ID/slug, or multiple category IDs/slugs defined via an array, or multiple categories IDs/slugs defined via a comma-separated and/or space-separated string

  • $before (optional) To appear before the entire category listing (if categories exist or if 'none' setting is specified)

  • $after (optional) To appear after the entire category listing (if categories exist or if 'none' setting is specified)

  • $between (optional) To appear between categories

  • $before_last (optional) To appear between the second-to-last and last element, if not specified, 'between' value is used

  • $none (optional) To appear when no categories have been found. If blank, then the entire function doesn't display anything


  • These are all valid calls:
<?php c2c_linkify_categories(43); ?>
<?php c2c_linkify_categories("43"); ?>
<?php c2c_linkify_categories("books"); ?>
<?php c2c_linkify_categories("43 92 102"); ?>
<?php c2c_linkify_categories("book movies programming-notes"); ?>
<?php c2c_linkify_categories("book 92 programming-notes"); ?>
<?php c2c_linkify_categories("43,92,102"); ?>
<?php c2c_linkify_categories("book,movies,programming-notes"); ?>
<?php c2c_linkify_categories("book,92,programming-notes"); ?>
<?php c2c_linkify_categories("43, 92, 102"); ?>
<?php c2c_linkify_categories("book, movies, programming-notes"); ?>
<?php c2c_linkify_categories("book, 92, programming-notes"); ?>
<?php c2c_linkify_categories(array(43,92,102)); ?>
<?php c2c_linkify_categories(array("43","92","102")); ?>
<?php c2c_linkify_categories(array("book","movies","programming-notes")); ?>
<?php c2c_linkify_categories(array("book",92,"programming-notes")); ?>
  • <?php c2c_linkify_categories("43 92"); ?>

Outputs something like:

<a href="http://yourblog.com/category/books">Books</a>, <a href="http://yourblog.com/category/movies">Movies</a>

  • <ul><?php c2c_linkify_categories("43, 92", "<li>", "</li>", "</li><li>"); ?></ul>

Outputs something like:

<ul><li><a href="http://yourblog.com/category/books">Books</a></li><li><a href="http://yourblog.com/category/movies">Movies</a></li></ul>
  • <?php c2c_linkify_categories(""); // Assume you passed an empty string as the first value ?>

Displays nothing.

  • <?php c2c_linkify_categories("", "", "", "", "", "No related categories."); // Assume you passed an empty string as the first value ?>


No related categories.


The plugin exposes one action for hooking.

c2c_linkify_categories (action)

The 'c2c_linkify_categories' hook allows you to use an alternative approach to safely invoke c2c_linkify_categories() in such a way that if the plugin were to be deactivated or deleted, then your calls to the function won't cause errors in your site.


  • same as for c2c_linkify_categories()


Instead of:

<?php c2c_linkify_categories( "43, 92", 'Categories: ' ); ?>


<?php do_action( 'c2c_linkify_categories', "43, 92", 'Categories: ' ); ?>

Requires: 2.8 or higher
Compatible up to: 4.5.5
Last Updated: 9 months ago
Active Installs: 200+


0 out of 5 stars


Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.