Forums

EASY Custom CSS based on Author (2 posts)

  1. mediaase
    Member
    Posted 3 years ago #

    I'm not sure if this will paste correctly with the code, so here's the link to the formatted instructions: http://www.shaneeubanks.com/blog/index.php/2006/01/04/easy-custom-css-based-on-author/

    I had been trying to figure out how to change the text (colors and such) of posts in WordPress based on the author and saw quite a few different ways of doing it…none of which I thought were easy. I’m not sure if this has been mentioned elsewhere before, because I couldn’t find it…so here is my two-step version. Yes…two steps.

    Now, this is going to describe how to do it with the default theme in WordPress 2.0, but I use it with the K2 theme over at http://www.crystalandshane.com to make my posts blue and Crystal’s posts pink .

    1. Open index.php in the /wp-content/themes/default folder and find the line that says:

    class=�entry�

    Replace it with:

    class=�<?php the_author() ?>“

    2. Open the style.css in the same folder and add styles based on the authors’ names. Here is how I use it for Shane and Crystal:

    .Shane {
    font-size: 1.4em;
    line-height: 1.2em;
    color: #393B79;
    }

    .Crystal {
    font-size: 1.4em;
    line-height: 1.2em;
    color: #9C4976;
    }

    Just save & upload those 2 files and you now have custom CSS styles based on the author’s name!

  2. mediaase
    Member
    Posted 3 years ago #

    I moved the article over to http://www.aiostudents.com/index.php/2006/05/30/custom-css-based-on-author-in-wordpress/

    I now added the custom CSS to the titles of the post in combination with CG-FlashyTitles....neat stuff.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags