Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>';
}
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php check if non-object 
Php :: php loop through array 
Php :: pusher-php-server laravel 
Php :: hide wordpress errors 
Php :: get taxonomy name in singhle post 
Php :: php foreach if last item 
Php :: how to open server in php 
Php :: determine special characters in php 
Php :: carbon minus 1 day 
Php :: laravel inline if 
Php :: 19 hours from now php 
Php :: php get hostname 
Php :: wordpress user enumeration 
Php :: php sha256 
Php :: php myadmin reset auto incremente 
Php :: public laravel htaccess 
Php :: laravel getbindings 
Php :: with in relation laravel 
Php :: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. 
Php :: Your Composer dependencies require a PHP version "= 7.3.0" 
Php :: laravel delete confirm link 
Php :: group by laravel 
Php :: wordpress get post author link 
Php :: laravel transactions 
Php :: send variable to get_template_part 
Php :: header location php 
Php :: Check duplicate email in laravel using jQuery validation 
Php :: center mode slick slider 
Php :: how to setup cronjob on cakephp on share hosting 
Php :: how to create a new component in laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =