• Resolved YvonneOH

    (@yvonneoh)


    Hi,

    How do I get the author name and post/page category to appear on my blog posts? Currently, I only have the published date displayed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • In loop
    <?php the_author(); ?>

    <?php $post_detail = get_the_terms( $post->ID, ‘taxonomyname’);
    $cat_id = $post_detail[0]->term_id;
    $cat_name = $post_detail[0]->name;
    echo $cat_name; ?>

    Thread Starter YvonneOH

    (@yvonneoh)

    Thanks but I’m not sure where to paste all this. What is ‘In loop’?

    To get author name in loop.
    <?php the_author(); ?>

    To get author name without loop.
    $author_id=$post->post_author;
    <?php echo the_author_meta( ‘display_name’ , $author_id ); ?>

    To get category name.
    <?php $post_detail = get_the_terms( $post->ID, ‘taxonomyname’);
    $cat_id = $post_detail[0]->term_id;
    $cat_name = $post_detail[0]->name;
    echo $cat_name; ?>

    Theme Author Ben Sibley

    (@bensibley)

    Hi Yvonne,

    Apex only adds the date for the posts on the blog, but the categories and tags are displayed on the post page at the bottom: https://pics.competethemes.com/image/1p16291a3b3T

    To display the author name, what about using a plugin like this to add a bio section after each post: https://www.ads-software.com/plugins/starbox/

    Would that work well for your site?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display author name and category on my posts?’ is closed to new replies.