Single Post Template Functions

Prints date even if on second post on same day. $post_id is optional if inside of posts loop. See Formatting_Date_and_Time for $format value.

<?php $date = get_the_date( $format, $post_id ); ?>

Does not print date if displaying second post on same day in loop, or second time used on single post. (For example, if you use this function to display the time and also set datetime attribute of <time> HTML tag, the second time used in template the date will not display.)

<?php the_date() ?>

List current post’s categories as links with separator between each:

<?php echo get_the_category_list( $separator, $parents, $post_id ); ?>

List current post’s custom taxonomies as links with separator between each:

<?php echo get_the_term_list( int $post_id, string $tax_name, string $before = '', string $sep = '',string $after = '' ); ?>

Get current post’s categories as an array:

<?php $cats = get_the_category(); ?>

Display comma separated post’s categories that are not linked:

<?php 
$cats = get_the_category(); 
echo implode(', ', array_column($cats, 'name')); 
?>

List all blog categories as links. See wp_list_categories

<?php wp_list_categories( string|array $args = '' ); ?>

Next/Previous Post Link. See next_post_link also previous_post_link with same params.

<?php next_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ); ?>

Example:

<?php echo next_post_link(  '%link', 'Next >' ); ?>
Do NOT follow this link or you will be banned from the site!