The Ultimate WordPress Sideblog

A sideblog, or asides as they’re sometimes called, is a great addition to a blog. It allows you to post short mini-posts into a spot in your sidebar.

Have you just hit the Digg.com main page? Give your readers a heads up. Did you just think of an idea your users may want to here? Sideblog it! Sideblogs are great for sharing links as well as posting updates. If you need more convincing, read Why You Should Use A Sideblog.

Let Michael Martin convince you to use a sideblog. This post is about setting one up.

The Plugin

  1. Download and install the WordPress Sideblog Plugin.
  2. Create a new category called “Sideblog” or something of the sort.
  3. Login to your WordPress Admin and go to Options -> Sideblog.
  4. Check-mark the Sideblog category and check the box marked “Exclude from feeds.” Set the number of entries you want displayed, then click “Update Sideblog Options”.
  5. Add <ul><?php sideblog('categoryslug'); ?></ul> to your sidebar template where you want the sideblog to appear.
  6. Style the sideblog however you want, and making use of the “Display Format” box on the Options -> Sideblog page and CSS if necessary.

Functions.php

WordPress themes are allowed to have a cool little file called functions.php. I could rave about it for hours, but I doubt you want to stick around for that. :D If you don’t know what functions.php is, read about it at WordPress.org.

Once the Sideblog Plugin is installed, open-up your theme’s functions.php file. If there isn’t one, create it. Just name a plain-text file functions.php and add the “begin/end PHP block” tags:

<?php

?>

Once you have your functions file ready, add the following code between the PHP tags. Be sure to replace 75 with the id for your Sideblog category.

function killAsides($query) {
if ($query->is_archive) {
$query->set('cat','-75');
}
return $query;
}
add_filter('pre_get_posts','killAsides');

What does it do? It makes sure your Sideblog entries don’t appear on date-based archive pages (the plugin removes them from the index and RSS feed). You don’t want all your short, two-sentence posts cluttering them up, do you? If you do, you can skip this step. It’s a matter of preference.

Customize Single.php

Your sideblog entries are puny. Do they really need an entire permalink page all to themselves? If you want, you can remove parts of the single.php template for sideblog entries. Suppose you want to take the comments and comment form out. All you have to do is take the line

<?php comments_template(); ?>

and change it to

<?php if (!in_category('cat_id')) { ?><?php comments_template(); ?><?php } ?>
.

You need to replace cat_id with the numerical category id, of course.

Stop the Bots

Google doesn’t like pages with “little original content.” Basically the post pages of the sideblog entries have a couple of sentences of content…and the rest is the blog template. You end up with the header, sidebar, and about ten words of original content. The header and sidebar appear on every other page on your site…not good.

What can you do? You can tell search robots to ignore the sideblog entry pages using this code (thanks to Michael Martin):

<?php if(is_category('75') || in_category('75')) { ?>
<meta name="robots" content="noindex, nofollow">
<? } ?>

Just add it in to your blog’s header, replacing 75 with your category id again.

Search engines will totally ignore the sideblog permalink pages. Note that search engines will still follow sideblog links as your Sideblog appears in your sidebar, and in the category archives (www.yourblog.com/category/sideblogcategory).

Add a Feed

You’ll probably want to offer your readers a feed for the Sideblog. WordPress generates one automatically (even if it doesn’t advertise it). It’s accessible at www.yourblog.com/category/sideblogcategory/feed/. If you’re not using “pretty permalinks,” then you may append ?feed=rss2 to the category URL. Feel free to use Feedburner with the RSS feed.

Enjoy your sideblog!

  • http://www.clutter-cubed.com Caitlin

    Thanks for the tips! I was wondering how to implement the Sideblog plugin without having it in the archives or picked up by bots, etc.

    However, editing the functions.php file seems to break my blog. :/ I added the php tags, and the snipped of code you provided, and changed the 75 to my actual category ID number (mine happens to be 19). I have not added any white space or extra characters.

    It throws up a T-STRING error, referencing the line “add_filter(’pre_get_posts’,’killAsides’);”

    I know how to edit php files in WP, what else could I be doing wrong with your update?
    Thanks!

  • http://www.webmaster-source.com Matt

    The above section “stop the bots” covers how to stop search engines from indexing your sideblog.

    Okay, about your error…
    Are you pasting the code directly from here into functions.php? Often, if you do that, it causes problems. WordPress has a nasty habit of replacing standard quote marks (in posts) with fancy curly-quotes. After pasting the code into functions.php, try re-typing the quote marks. Just select and type-over. Let me know if that works.

  • Pingback: Post “Shorts Posts” with the Sideblog Plugin at WordPress Themes, WordPress Plugins, Blog Tips, WordPress Optimizations >> WPthemesplugin.com

  • Pingback: News » Post “Shorts Posts” with the Sideblog Plugin

  • Pingback: BlogUpper | New Micro Blog

  • asfodel

    I’ve been looking for a way to do just the opposite: allow sideblog posts to appear in archive pages and also to be findable in the search. Right now they are neither.Any suggestions?

  • http://www.webmaster-source.com Matt

    @asfodel: How are you handling your sideblog currently? A specific plugin or something?

  • http://www.antoniowells.com Antonio Wells

    This is good. I was looking for a solution for a side blog. Great post, Thanks!

  • http://stevebrodner.com/home/ Ken

    Thanks. I got it to work but want to kill Sideblog Categories from sidebar. How do I do that?

  • http://www.webmaster-source.com Matt

    Just edit your wp_list_categories() template tag and tell it to exclude the category id you specify with the “exclude” parameter.

    http://codex.wordpress.org/Tem.....categories

  • http://stevebrodner.com Ken

    (I’m back. Got lost on another job)
    I think I get it. I want to add this code:

    But in which file do I find/edit it? That is not clear to me.
    I added it at the end of sidebar.php but it did not exclude “sbaside01,” from the Category list. That is the top post in the middle column.
    Thanks

  • http://www.webmaster-source.com Matt

    @Ken, You want to add it to functions.php in your theme. If the file doesn’t exist, create it, and make sure to put opening and closing “< ?php" and "?>” tags.

  • http://www.regrouped.net kevin

    hey all, am tryig to make sideblog work but cant manage, i have no options available or to select in the admin part. Could it be due to my WP version 2.3.2 ?

  • http://www.regrouped.net kevin

    Hey me again, i installed WP2.7.1 locally on my computer to try and i still dont have anything i can select in the options of the sideblog plugin. Any idea ?

    • http://intensedebate.com/people/redwall_hp redwall_hp

      If you're having trouble with Kate Gasis's WordPress Sideblog Plugin, then you should probably ask through the official forums. It will get noticed by the proper people there. http://wordpress.org/tags/sideblog

  • http://www.regrouped.net kevin

    ok, i'll have a look. thanks.

  • Remar

    I think that if you have a blog, then it is what you need.
    Tell people about something, someone is advertising, to somebody else for something else.
    Personally, I think so.
    Here I have a blog about my travels, but I can not share them with people, because somebody would write that this is spam.
    A hoster will also kick :)