Two New Widgets Released

I threw a couple of new widgets out there for folks to have some fun with.

Featured Blog Tag Cloud and Shortcode
We use this one together with Donncha’s sitewide tags plugin, so we can have a tag cloud on your site’s home page that references the tags from the tags blog. The shortcode just allows you to pass in the ID of the blog you want, otherwise it acts pretty much just like the built-in shortcode, but with the defaults set a little differently – you can set the defaults directly in the code if you prefer different ones.

Featured Blog Widget
This widget lets you pick a featured blog and a featured author within that blog, and it will display the avatar of the featured author and a user-specified number of posts from the blog.

Both of these came out of the work that we were doing on an internal blog server – so they might be a tad bit customized in terms of layout. But, they’re good starting points if you need to do something similar.

About these ads
Leave a comment

20 Comments

  1. Hi Deanna,

    Thanks for the great work on your featured blog widget, I appreciate the work you put into this.

    Would it be possible to not only read the latest blog posting, but to also include say the first 600 words or 15 lines (maybe user specified how much to include) with the post?

    I would like to feature a regular content write and have them write posts to their own blog which is pulled into the main page where visitors can read part of the post and if they like to continue, click the more link.

    Thanks again for the great work :).

    Reply
    • It’s fairly easy to do. On line 86, just add the following (ugh code snippets don’t seem to work in comment tags here, so bear with me):

      <?php the_excerpt(“Read the rest of this entry »”); ?>

      That will add an excerpt for each post. If you wanted to customize it more, that would be a bigger issue – not hard just a bit more customizing time. But, that’s the quick and dirty way.

      Reply
  2. Thanks for the reply Deanna.

    Do I add this before or after the closed li tag?

    That’s currently what I have on line 86 of featured_blog.php

    Reply
  3. Just an update, I placed the code before the tag on line 86 and it made my site stop working.

    Any other ideas?

    Reply
  4. I’m working on an update. Will be released later today.

    Reply
  5. Awesome work Deanna! :). Thank you so much for taking the time to update this plug-in with the feature I asked for.

    Is it possible to have it feed the blog with the paragraph separations intact?

    PS: Do you have a paypal for donations? :D

    Reply
  6. I’m using the built-in excerpting functions, and handling it the same way WP does internally. So, probably not. It basically strips the HTML and shortcodes and such so that you don’t break the rest of your site layout by cutting off in the middle of some HTML tag. Sorry.

    Reply
  7. Oh, and while the thought of Paypal donations is nice, I do this as part of my regular job, so I’m not allowed to take any extra moola for it. :)

    Reply
  8. Hello,

    I have made a french translation for the Featured Blog Widget.

    For doing this, it was necessary to do some hacks on code :

    1. Declare a “texte domain”:
    load_plugin_textdomain( 'cets_featured_blog', 'wp-content/mu-plugins', false );

    2. Introducing on each text strings the call to the “texte domain”. For exemple:
    <a href="">

    3. Correcting a small bug : there was no description text for the widget only twice the title (wpmu 2.8.5.2)… For correcting this I have to hack the cets_widget_featured_blog() function introducing these lines:


    $widget_ops = array('classname' => 'cets_widget_featured_blog', 'description' => __('A widget that pulls the avatar of a user and the most recent posts in headline format from a featured blog', 'cets_featured_blog') );
    $this->WP_Widget( 'cets_widget_featured_blog', __('Featured Blog', 'cets_featured_blog'), $widget_ops, $control_ops );

    If you want to grab the source and the .mo/.po files:
    http://medialab.samizdat.net/pub/wordpress-mu/

    Reply
  9. Aris

     /  November 24, 2009

    It was a pleasure ;-)

    All community, all GPL

    Reply
  10. I would love to use this widget on my homepage of weblog.com but that page itself is not widget ready.

    Do you know of a way I would be able to implement this by adding plugin code rather than making the whole theme widget ready?

    Thanks!

    Reply
  11. @Chris – which one, the featured blog or the featured tag cloud?

    Reply
  12. Sorry! The featured blog.

    Reply
    • Hey Chris,
      I took a look at this today and tried to come up with some clever way to do it. Unfortunately, there’s isn’t anything quick and easy. It would amount to rewriting this all as a plugin instead of a widget. (The widget architecture isn’t designed to be called outside the widget framework.) The good news is that it’s super easy to widgetize your theme. There’s a great tutorial here:
      http://www.themelab.com/2008/04/18/see-how-easy-it-is-to-widgetize-wordpress-themes/

      If you really don’t want to widgetize the theme, then I can give you some pointers on what to do with the widget code. You’re essentially stripping the stuff out of the widget function that begins on line 37 and making a standalone function out of that. The best place to do that would be in the functions.php of your theme. Make sense?

      Reply
      • Deanna, I appreciate the effort. No worries, I guess I’ll just have to get with the times and widgetize my theme :)

        Thanks

        Chris

  13. @DeannaS any idea?

    Thanks!

    Reply
    • I can probably come up with something, but I’ve been on vacation and today I’m furloughed – so no “working.” I’ll look at it tomorrow.

      Reply
  14. haha i hear that. no worries

    Thanks!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: