How To Get Category Name ,Author Name And Date In WordPress

Get Category :

You can get category name by perticular post

<?php $categories = get_the_category(); $separator = ' ';
$output = '';
foreach($categories as $category) {
$output .= '<a href="'.get_category_link( $category->term_id ).''
. esc_attr( sprintf( __( "" ), $category->name ) ) . '">
} echo trim($output, $separator); } ?>

Get Auther Name :

You can get author name by perticular post

<?php the_author_posts_link(); ?>

Get Posted Date :

<?php echo the_time(get_option('date_format'));?>
Also you can get Number of comments
<?php $commentscount = get_comments_number(); echo $commentscount; ?>

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s