DIY WordPress: Hyperlinking Author’s Byline In WordPress Journalist Theme

(Reading time: 1 – 2 minutes)

Check this out:

Hyperlink to author's archive

Hyperlink to author's archive

Can you see it? The author’s byline is now hyperlinked to pages listing all of the author’s posts.

This is fantastically easy to do. Just change this code:

1
the_author();

to

1
the_author_posts_link();

That’s all there is to it!

Here’s a screenshot to help you out:

Use the_author_posts_link() for hyperlinking byline

Use the_author_posts_link() for hyperlinking byline

DIY WordPress: Styling The Author’s Byline In WordPress Journalist Theme In 3 Steps

(Reading time: 3 – 4 minutes)

Give the author byline more punch

Give the author byline more punch

The WordPress Journalist is an excellent theme for anyone wanting to use a blog to deliver a lot of information with a minimum amount of fuss.

Part of what makes Journalist such a good theme is that it’s easy for WordPress beginners to modify in simple, powerful ways. For example, moving the author’s byline from below the post to above the post is very simple.

But the default author styling is too plain. Let’s add a little punch to it using a bold font, as shown in the screenshot above.

WARNING: Make a fresh backup before poking around in theme files.

Add font format class to style.css

CSS styling for post author

CSS styling for post author

We’ll need to either 1. find an existing class in the Journalist style sheet, or 2. create a new, custom CSS class just for ourselves. I’m going to save you some time here… I poked around in the Journalism style.css file, and I didn’t find anything useful for simple author byline formatting.

Since we want to restyle the author’s byline, let’s make it really easy and create a CSS class called “theauthor.” Here’s how:

  1. Click on “Appearance >> Editor” in your sidebar menu. This will open in the style.css file.
  2. Scroll to the bottom of style.css
  3. Add this formatting, also shown in the screenshot:
    1
    2
    3
    
    span.theauthor {
       font-weight: bold;
    }

That was easy! Now, we need to add the styling information to each page template in the theme.

Add class to page templates

As noted in “Moving The Author’s Byline In WordPress Journalist Theme,” 5 files need to be modified: archive.php, single.php, index.php, search.php and page.php. Below is a screenshot of what this looks like in your theme editor:

Add styling information to the page templates

Add styling information to the page templates

As you can see, it’s pretty easy. Just wrap the_author() tag with the span, here’s what the code looks like:

1
<span class="theauthor"><?php the_author() ?></span>

Again, easy business. Make sure to add the span to all 5 files, and check to make sure everything works. If you make a mistake, it will break your website, and you will notice. So will everyone else. It’s not hard, just take care. This is why you did a backup before you started, right?

Is there more you want to do with the author information? There’s more I’m going to do. Stay tuned.