Answers for "how to find category name in WordPress database"

PHP
0

display category name wordpress

<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
	echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
}
?>
Posted by: Guest on December-18-2020

Code answers related to "how to find category name in WordPress database"

Browse Popular Code Answers by Language