WordPress.org

Ready to get started?Download WordPress

Forums

Add Author Hyperlink to Scrappy Theme (5 posts)

  1. glamlifeblog
    Member
    Posted 2 years ago #

    Hi!

    Can someone please tell me how to add the author link at the bottom of a post where the tags and categories are listed? There are 4 different authors and I want to link to their work (for this blog) when you click on their names.

    I'm using a child theme and I only have the style.css part.

    My CSS knowledge is suuuper basic, but I've made a few changes by trial and error. (Took hours!) Anyway, the website is http://glamlifeblog.com/.

    Thanks to anyone who can help!

  2. mzix
    Member
    Posted 1 year ago #

    I would love to figure this out too. I also have a blog with multiple authors.

    I found this in another thread not realizing it might be different for the theme.

    <p>This post was written by <?php the_author(); ?></p>

    I put it in the index.php, but it still didn't show up. For now, I'm using a different theme that shows the different authors for each post.

  3. Caroline Moore
    Member
    Posted 1 year ago #

    If you're using a child theme, you'll want to copy content.php from the original theme into your child theme folder, then open it and add this code where you'd like the author link to appear, probably just after line 62 if you want it to come after the tags:

    <span class="byline"> by <span class="author vcard"><a class="url fn n" href="<?php esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php esc_attr( sprintf( __( 'View all posts by %s', 'scrappy' ), get_the_author() ) ); ?>" rel="author"><?php esc_html( get_the_author(); ?></a></span></span>

    You may need to do some additional styling in your child theme's style.css to get it to look the way you want.

  4. mzix
    Member
    Posted 1 year ago #

    I have no idea if I'm using a child theme or not. :-\

  5. Caroline Moore
    Member
    Posted 1 year ago #

    @mzix: That was mostly for the OP, who said she was using a child theme. :) I highly recommend using one any time you want to modify an existing theme. You can read more about child themes here.

Topic Closed

This topic has been closed to new replies.

About this Topic