# betterdocs/4.9.3/views/template-parts/category-title.php

BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ &amp; Chatbot, version 4.9.3. 20 lines.

- Page: https://pluginprobe.com/plugins/betterdocs/4.9.3/code/views/template-parts/category-title.php
- Raw: https://pluginprobe.com/plugins/betterdocs/4.9.3/raw/views/template-parts/category-title.php
- Modified: 2026-06-23T11:52:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/betterdocs/4.9.3/code/views/template-parts/category-title.php#L10-L20`.

```php
<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.


if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
$tag                 = betterdocs()->template_helper->is_valid_tag( $tag );
$category_title_link = isset( $category_title_link ) ? $category_title_link : '';
if ( isset( $widget_type ) && ( $widget_type !== 'category-box' ) && ( $widget_type == 'category-grid' && $category_title_link ) ) {
	$title = wp_sprintf( '<a href="%s">%s</a>', $permalink, $title );
}

//for related categories title
if ( isset( $widget_type ) && ( $widget_type == 'related-categories' ) ) {
	$title = wp_sprintf( '<a href="%s">%s</a>', $permalink, $title );
}

echo wp_kses_post( '<' . $tag . ' class="betterdocs-category-title">' . $title . '</' . $tag . '>' );

```
