HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/meysamkiani.com/root/wp-content/themes/author/content/post-categories.php
<?php

$categories = get_the_category( $post->ID );
$separator  = '';
$output     = '';

if ( $categories ) {
	echo '<div class="post-categories">';
		echo '<span>' . _x( 'Published in', 'Published in post category', 'author' ) . '</span>';
		foreach ( $categories as $category ) {
			// output category name linked to the archive
			$output .= '<a href="' . esc_url( get_category_link( $category->term_id ) ) . '" title="' . esc_attr( sprintf( _x( "View all posts in %s", 'View all posts in post category', 'author' ), $category->name ) ) . '">' . esc_html( $category->cat_name ) . '</a>' . $separator;
		}
		echo trim( $output, $separator );
	echo "</div>";
}