You are here: Home » Extending WordPress » DIY WordPress: Styling The Author’s Byline In WordPress Journalist Theme In 3 Steps

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

by Dave Doolin on August 19, 2009 · 4 comments

(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.




Would you like more? Send me a letter...
"Hi Dave,
Website In A Weekend seems pretty cool. I'm serious about this WordPress and web stuff, and I'd like to keep up with it. My name is and my email address is . I'm comfortable with email newsletters. I know you will protect my privacy, and that I can unsubscribe at any time. "

{ 4 comments }

Marlon August 20, 2009 at 7:49 pm

Nice post!
Thanks!

Andrew September 14, 2009 at 8:09 pm

Hey,

Great post! I’m using the journalist theme and am trying to find out how to change the ‘without comments’ that appears underneath my post title if no one has made a comment on my blog?

Cheers,

Andrew

Dr Wordpress! September 15, 2009 at 5:18 am

@Andrew – this isn’t too difficult. I’ll see about getting a post up about it within a day or two.
Dr Wordpress!´s last blog ..Startup Weekend Women 2.0 August 28, 2009: Proposal My ComLuv Profile

Dr Wordpress! September 16, 2009 at 9:13 am

@Andrew –

I don’t have to write this up at the moment.

However, it’s pretty easy. Poke around in the index.php and the page.php files, and you will see what you need to do.

Make a copy of your theme before you go breaking stuff.

Comments on this entry are closed.

Previous post:

Next post: