WordPress Tips Part 2

This post is guest blogged by Milo of 3OneSeven.com. For all codes, type them out. Do not copy and paste. And here’s part 1.

Tip #6: Add Gravatars Without a Plugin

  1. Open your comments template and find this line:
    <li class=”<?php echo $oddcomment; ?>” id=”comment-<?php comment_ID() ?>”>
  2. After that line, add this set of codes.
     comment_author_email)) {
    
    $md5 = md5($comment -> comment_author_email);
    
    $default = urlencode('PATH to default image');
    
    echo "";
    }
    ?>
    
  3. Adjust the path to your default image shown when no gravatar is signed.

Tip #7: How to Add a Side Blog

  1. Set up the desired category or choose a current one.
  2. Add the following code to your functions.php file:
    <?php
    function asidesFilter($query) {
    if($query->is_feed || $query->is_home || $query->is_ search) {
    $query->set(‘cat’, ‘-17′);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘asidesFilter’);
    ?>

    (Notice the number 17 is the category ID number for the chosen category. Yours will be different.)

  3. Add the following code to your sidebar, assuming you do not work with widgets:
    <h3>TITLE
    <a href=”FEED URL” title=”The Asides RSS feed.”>
    <img src=”RSS IMAGE URL” alt=”RSS” style=”position: relative; left: 0;” />
    </a>
    </h3>
    <?php query_posts(‘cat=17&showposts=4′); ?>
    <?php if(have_posts()) : ?>
    <?php while(have_posts()) : the_post(); ?>
    <div class=”aside_post”>
    <?php the_content(‘Continue reading this article’); ?>
    </div>
    <?php endwhile; ?>
    <span class=”aside_archive_link”>
    <a href=”CATEGORY URL” title=”More asides.”>Archives</a>
    </span>
    <?php else : ?><p>Sorry, the sideblog is having a little trouble.</p>
    <?php endif; ?>

Tip #8: Customizing The Read More Link

  1. Open your index php or home php file and find this line:
    <?php the_content(__(‘Read more’));?>
  2. replace it with this one:
    <?php the_content(“Continue reading ” . the_title(”,”,false), 0); ?>

Tip #9: Customizing The Comments Link

  1. Open your index.php, archive.php, home.php files and find this line:
    <?php comments_popup_link(‘Leave a Comment’, ’1 Comment’, ‘% Comments’); ?>
  2. Replace it with this one:
    <?php comments_popup_link(__(‘No comments on ‘ . the_title(”,”,false)), __(‘One comment on ‘ . the_title(”,”,false)), __(‘% comments on ‘. the_title(”,”,false))); ?>Of course customizing the No Comments text and further is ok too.

Tip #10: Customize the WordPress Login

  1. Download from /wp-admin/images/ these two images:
    login-bkg-tile.gif
    login-bkg.bottom.gif
  2. Create two new images with same width and height
  3. Save them with the same name and file extension (.gif). Of course, you can use other extensions, but then you have to edit the admin.css too to match it.
  4. Upload it to the /wp-admin/images/ folder

Tip #11: Customize the WordPress Admin

  1. Download from /wp-admin/ this css file:
    wp-admin.css
  2. Admin link colours, find this line:
    a {
    border-bottom: 1px solid #69c;
    color: #00019b;
    text-decoration: none;
    }

    Adjust color to your linkings

  3. Admin link colours, find this line:
    a.edit:hover {
    background: #ccc;
    color: #036;
    }
    a:visited {
    color: #006;
    }
    a:hover {
    /* border-bottom: 1px solid #3a75ae;*/
    color: #069;
    }

    Adjust color to your linkings

  4. Don’t like Lucida Grande with serifs, adjust this:
    body, td {
    font: 13px “Lucida Grande”, “Lucida Sans Unicode”, Tahoma, Verdana;
    }
  5. Admin top header background:
    #adminmenu {
    background: #6da6d1;
    border-top: 3px solid #448abd;
    margin: 0;
    padding: .2em .2em .2em 2em;
    }
    #adminmenu a {
    color: #000;
    font-size: 14px;
    font-weight: normal;
    margin: 0;
    padding: 3px 5px;
    text-decoration: none;
    }
    #adminmenu a:hover, .current {
    background: #ddeaf4;
    color: #333;
    }
  6. Admin second level header background:
    #submenu {
    background: #0d324f;
    border-bottom: none;
    margin: 0;
    padding: 3px 2em 0 3em;
    }
    #submenu .current {
    background: #f9fcfe;
    border-top: 1px solid #045290;
    border-right: 2px solid #045290;
    color: #000;
    }
    #submenu a {
    border: none;
    color: #fff;
    font-size: 12px;
    padding: .3em .4em .33em;
    }
    #submenu a:hover {
    background: #ddeaf4;
    color: #393939;
    }
  7. This is just a rough guide for changing link and background colors. No margins or padding were touched. However, when finished, your wp admin can look like this.

From Small Potato

Milo is a graphic and web designer based in Munich, Germany.

You May Also Like

Avatar of Jazib Zaman

About the Author: Jazib Zaman

Leave a Reply

Your email address will not be published. Required fields are marked *