Don't bother looking for the 'social' buttons to share, save or bookmark this post: Leave your feedback in the comments and get the discussion started!

Posted on 8 October '08 \ Categories: blog, develop \ Tags: , ,

The Unstandard theme: widgetized and gravatar-ized

The minute I came across the unstandard theme I knew it was the perfect theme for what I had in mind for Aytemir.com.

However I found out that it lacked a bunch of essentials features, which I missed dearly. And although there are some snippets in the comments and the forum they’re just not complete or they didn’t work for me: hence The Unstandard theme version 2, which adds the following extra’s on the already excellent theme:
-Text replaced with a logo
-Sidebar widgetized, with correct CSS layout
-Footer widgetized, with correct CSS layout
-Gravatar in comments

Live demo: You’re looking at!
Download: The Unstandard theme version 2.0!

Note: all copyrights, licence and credits concerning both versions are still a property of Derek Punsalan/5thirtyone.com.
The Unstandard v2.0 theme is distributed as is: You’re advised to install and test it locally (with XAMPP or WAMP) first and backup your originals.

It’ll probably work ‘out of the box’: I’m using it locally and live with WordPress version 2.6.2. Please leave a comment if you’re having troubles with it.

UPDATE: Manually upgrade

If you’re already using the original Unstandard theme and you’ve already hacked it a bit than you might consider following these steps to ‘upgrade’ it manually to version 2.0:

1.Gravatarize

Somewhere around line 32 in comments.php after

<div class="fix">
				<div class="author_meta">

add the following

<?php if(function_exists('get_avatar')) { echo get_avatar($comment, '75','http://www.aytemir.com/wp-content/themes/unstandard/images/default_avatar.png'); } ?>
<br/>

BONUS: the last parameter is not required. It only replaces the default WordPress avatar (mystery man) with your own default avatar!
BONUS: you might also consider reversing the comment order by displaying the last post at the top. Just add the following

<?php foreach (array_reverse($comments) as $comment) : ?>

just after this line

<ol class="commentslist">

2a.Widgetize sidebar

First copy functions.php to your themes root: copy this file from the above zip-package!
And in your sidebar.php add the following code, where you want your sidebar widget to appear

<ul class="sidebar-ul">
  <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
  <?php endif; ?>
</ul>

2b.Widgetize footer

Edit your footer.php and add the following code, where you want your footer widgets to appear (in my case/Aytermir.com right at the top)

<ul class="sidebar-ul">
<div id="subfooter">

<div class="widget"><div class="inner">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("subfooterleft") ) : ?>
<?php endif; ?>
</div></div>

<div class="widget"><div class="inner">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("subfootercenter") ) : ?>
<?php endif; ?>
</div></div>

<div class="widget"><div class="inner">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("subfooterright") ) : ?>
<?php endif; ?>
</div></div>

</div>
</ul>

And adjust the CSS style.css by adding the following at the bottom

/* highlight author comments*/
.authcomment {
background-color: #B3FFCC !important;
}

/* widgetizing the footer */
#subfooter {
width:960px;
margin-left:0px;
margin-right:0px;
height:300px;
clear:both;
}

#subfooter .widget {
width:310px;
float:left;
margin-left:0px;
margin-right:10px;
}

#subfooter .widget .inner {
padding:0px;
}

BONUS: the first part will highlight the author comments!

3.Logo instead of title text

While your busy why not replace the title of your blog with a cool logo Don’t forget to replace my URL’s with your own! Just edit your header.php

<a href="http://www.uppedd.com"><img src="http://uppedd.com/wp-content/themes/unstandard/images/logo.png"></a>

just after

<div id="leaderboard" class="fix">

BONUS: Why not add a favicon while your busy hacking? Just add the following in your header

<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" />

Add it just after the < head > tag and upload your favicon.ico in your theme root.

UPDATE 2: Fixing the Recent Comments

Get this widget: Widget for Simple Recent Comments, although the default one is fine too, this one can be tweaked more.
Alter line 100 according to the following.

$output .= "\n\t<li><a href=\"" . get_permalink($comment->ID) . "#comment-" . $comment->comment_ID  . "\" title=\"on " . apply_filters('the_title_rss', $comment->post_title) . "\">" . $comment->comment_author . ": ''" . strip_tags($comment->com_excerpt) . $dots . "''</a></li>";

That should do the trick!

UPDATE 3: An Unstandard Pagination

Wanna add pagination in your Unstandard theme homepage? Just follow these installation tips at Adding Nice WordPress Pagination.
And find in your home.php

<?php query_posts('showposts=9'); ?>

and change it into

<?php query_posts(); ?>

And don’t forget to adjust in your Settings > Reading > Blog pages show at most the desired number of posts to show. For example 9.

69 Responses to “The Unstandard theme: widgetized and gravatar-ized”
  1. Tschai says:

    Their probably shown vertical instead of horizontal because of some bullet, list elements like

  2. . You might want to use the CTC plugin in the get_categories.php, where you can decide to show tags/cats in diff layouts…

    Don’t know ’bout child-categories though, whether this template is suitable for it…

  • Hey there,

    I’m getting 2.7 up and running but it seems to lack a basic “read me” file with directions. I guess I must be thick in the head, but can you tell me how to add article pics to the homepage?

    Thanks in advance!!

  • Rohin says:

    Hey chai , I’m back for some more of your wisdom

    I’ve edited some of the code so that the plugin wp- page navi works , the first weird thing is that when you click the second page the first page’s story is still the featured one on top (I figured the second page’s top story would be the featured one with a bigger picture)

    Second which is more important to me is that is there a way to customize the search page results ? At the moment if someone searches only 7 post boxes come up , I was wondering if it’s possible without tampering with the home / index files.

    thanks chai you the best

  • Matthieu says:

    Thank you, really nice work :)

  • Giordany says:

    Hey Tschai,

    I need your help. I got the latest version of the unstandard theme, however, my lead_key isn’t working, it won’t generate a picture no matter what I try, however the secondary_image works fine. All the necessary folders are writable. I’ve looked at all the related content at the theme developer’s site but nothing helps. I asked him the same questions about it but he hasn’t responded. Any help will be greatly appreciated, thanks for your time!

  • Juned says:

    Hi, the download link is broke, I get not found error.
    Can you provide me the work link?
    I think the version you’ve edit is improve so much better than the orginal one.
    Thanks.

  • Rohin says:

    thanks chai I’ll try it asap. If not that I wonder if there’s some code in the php file that I can edit so that I can just put 2 more widget sidebars there instead with the same color formatting so it doesn’t stick out too much

  • Tschai says:

    You can add virtually anywhere the code in step 2b #
    < ?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(“subfooterright”) ) : ?>
    #
    < ?php endif; ?>

    to show there you’re desired widget…

    You can change ‘subfooterright’ to which one you need.

  • Rohin says:

    i posted on wordpres.org about

    just want to have cat’s horizontal , no one posted yet lol. By the way could you give me a critique of my site if you have a few seconds to spare ?

  • Tschai says:

    Wel the answer seems to be very simple: This is how my show_categories.php looks now

    [code lang="php"]
    < ?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

      < ?php wp_list_categories('title_li='); ?>

    [/code]
    And as you can see now here (on this blog!), the categories are shown horizontally…

    Hope this works for you too…

    Some remarks about your site:
    -It takes too long to load the data from twittercounter.com: you will loose visitors with it,
    -Don’t forget to replace the Unstandard orange color in the categories section,
    -I think you’re using two styles mixed/together: the edgy/sharpy Unstandard and rounded corners/circles, somehow it’s does not match
    -And also I see to many different shades of blue; you should stick to only 3 or 4 max

    I think overall, the site looks good and has interesting content. For this type of content you might consider the List Post titles, which somehow gets my attention always ;)
    And allow me to point you to my personal ‘wisdom’ about building sites and apps ;)

  • Tschai says:

    Actually it’s very easy:

    Add a custom field ‘lead_image’ and ‘secondary_image’ in your posts and make sure their sizes are 593×225 and 293×150 and they should be shown automatically.

    Hope this helps…

    –edit–
    Just realized that this probably wont go for the 2.7 version?
    I’m afraid you have to find your answer at http://5thirtyone.com/archives/1588 then, since I’m still using the pre-2.7 version

    The support at Derek’s blog is superb, so you should realy ask your question there

  • Tschai says:

    I’m aware of the first issue; haven’t found a solution yet and I’m not bothering anymore…kinda like it, actually ;)

    Concerning your second issue:
    You should get the number of posts you’ve set in your admin or the number of amount in your code: see ‘UPDATE 3: An Unstandard Pagination’ in this post.

    If you have adjusted your code like stated here, you should see the max amount set here /admin and you should be able to navigate to the rest of them.

    I have not tweaked something specific to achieve this…

  • Rohin says:

    yea i knew that but if i want 7 boxes in the regular home page , what do i do if i wanted lets say 15 boxes when someone does a search on my website ?

    thanks for the fast reply chai

  • Tschai says:

    You could try something like this

    < ?php if (is_search()): ?>
    < ?php query_posts(’showposts=15′); ?>
    < ?php else: ?>
    < ?php query_posts(); ?>
    < ?php endif; ?>

    All in home.php instead of the instructions in ‘UPDATE 3: An Unstandard Pagination’ in this post.

  • oliver says:

    this extension give you ability to control the number of post in each page, section, tag … of your blog : http://wordpress.org/extend/plugins/custom-post-limits/

    i’ve tested and its work perfectly for me