1<?php
2$categories = get_the_category();
3if ( ! empty( $categories ) ) {
4 echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>';
5}
6?>
1<?php
2 $user_info = get_userdata(1);
3 echo 'Username: ' . $user_info->user_login . "\n";
4 echo 'User roles: ' . implode(', ', $user_info->roles) . "\n";
5 echo 'User ID: ' . $user_info->ID . "\n";
6?>