Cleverness – WordPress Resources

To-Do List Plugin Major Upgrade

Download To-Do List Plugin – version 1.5 posted 03-09-2010

I’ve made a lot of improvements to the to-do list plugin over the past couple days.

Changes in version 1.2:

  • Added ability to check off items from dashboard
  • Added uninstall function
  • Added group support
  • Added settings page
  • Added permissions based on capabilities
  • Cleaned up code some more
  • Added ability to set custom priorities
  • Improved security
  • Added translation support

Updated To-Do List Plugin

Download To-Do List Plugin – version 1.5 posted 03-09-2010

This file was reuploaded at 7:25 PM EST 01/27/10. I had forgotten to correct the install function.

I’ve fixed the plugin so it is now able to be put in a subdirectory of /plugins/. I also added a readme.txt, license.txt, and moved the admin css to an external file.


To-Do List Plugin Posted

This plugin places an item under the Tools menu where you can manage your to-do list and also creates a dashboard widget that lists 10 items.

[Download not found]

Visit To-Do List Plugin Page

The plugin is a modified version of an abandoned plugin. I orginally just fixed it to work in WordPress 2.7 for my own use, but have since made additional improvements. I’ve improved the security of the plugin, updated the formatting to match the admin interface, and made some other small changes.


Show number of posts in a category

Tonight I needed to figure out how to display the number of posts that were in a specific category.

This post on Getting the number of posts per category showed me how to do that.

This goes into your template where you want the number to appear:

<?php echo get_category_by_slug('category-slug')->category_count; ?>

Replace category-slug with the slug of your category.


Updated WordPress Base Theme

Changes:

  • Added screenshot
  • Table formatting
  • Sticky post formatting

Upcoming Changes:

  • Definition list formatting
  • Improved comment formatting
  • Pre and Code formatting

Download WordPress Base Theme – version 1.1 posted 01-14-2010


Favorite Firefox Addons

There are a lot of great Fixfox Addons available. Some can help you in developing your WordPress site and some just make your browsing experience better.

Addon Name URL Description
Adblock Plus Website Ads were yesterday!
Backgroundimage Saver Website Save or View Backgroundimages (even if they are protected by hiding behind transparent Gifs).
CodeBurner for Firebug Website Extends Firebug with reference material for HTML and CSS
ColorZilla Website Advanced Eyedropper, ColorPicker, Page Zoomer and other colorful goodies
Delicious Bookmarks Website Access your bookmarks wherever you go and keep them organized no matter how many you have.
Download Statusbar Website View and manage downloads from a tidy statusbar
Dummy Lipsum Website Generate “Lorem Ipsum” dummy text.
FEBE Website Backup your Firefox data
Firebug Website Web Development Evolved.
FireDiff Website Track Changes in Firebug
FireFTP Website FTP Client for Mozilla Firefox.
FireShot Website Adds the ability to take a screenshot of the page entirely, edit it and save in (JPEG, GIF, PNG or BMP), print, copy to clipboard, send to external editor or e-mail it. Additional annotation tools (text, freeform drawing, highlights) provide quick and easy way of documenting of captures.
Font Finder Website Get all CSS styles of selected text.
Html Validator Website Adds HTML validation to the View Page Source of the browser. The validation is done by Tidy from W3c.
IE View Website Open pages in IE via Firefox menus
Image Spark Website Add images to your imgspark.com account by right clicking on any image.
JSView Website View the source code of external stylesheets and javascripts.
MeasureIt Website Draw out a ruler to get the pixel width and height of any elements on a webpage.
MR Tech Toolkit Website MR Tech Toolkit power tools for all users. (en-US)
Palette Grabber Website Creates a color palette for graphic design applications based on the current page.
SearchLoad Options Website Tweak the searchbar’s functionality.
Seo Toolbar Website The SEO Toolbar allows you to look at on page and off page competitive research details from the convenience of your Firefox browser as you browse the web. It also allows you to find keywords by putting many keyword tools at your fingertips.
Status-bar Calculator Website It’s a tiny calculator icon in the status bar.
Tab in Textarea Website Insert tab characters in textareas.
URL Fixer Website Fixes common misspellings in URLs entered in the address bar.
URL Link Website Allow navigation to broken/unlinked URLs
View Dependencies Website Adds a tab listing dependencies and their sizes in the Page Info window.
Web Developer Website Adds a menu and a toolbar with various web developer tools.

Replacing Core Functions

Replacing template core functions is easy and doesn’t require editing core files.

Copy the code for that function to functions.php in your theme, change the function name, and call it in your template using it’s new name.


Yearly Archives

Place the following in functions.php to list the archives for a specific month and year:

function getarchives_filter($where, $args) {
	if (isset($args['year'])) {
		$where .= ' AND YEAR(post_date) = ' . intval($args['year']);
	}
	if (isset($args['month'])) {
		$here .= ' AND MONTH(post_date) = ' . intval($args['month']);
	}
	return $where;
}

add_filter('getarchives_where', 'getarchives_filter', 10, 2);

This is what you will add to your template file:

<?php wp_get_archives('type=daily&month='.get_the_time('m').'&year=' . get_the_time('Y')); ?>

If you’ve been blogging for a number of years, it can sometimes be helpful to list your archives by years, then by months, then by days.

If you use this method, your archive page will list every year you have a post in. Then when you click on a year, it will take you to a list of the months you posted in that year. Then when clicking on a month, you go to a list of days you posted.

If you want to use this method, add the following code to archive.php:

	<?php while (have_posts()) : the_post(); ?>
        <?php if ( is_year() ) : ?>
			<ul id="archives"><?php new_get_archives('type=monthly&year=' . get_the_time('Y')); ?></ul>
		<?php elseif ( is_month() ) : ?>
			<ul id="archives"><?php new_get_archives('type=daily&month='.get_the_time('m').'&year=' . get_the_time('Y').'&format=custom&before=&after='); ?></ul>
		<?php elseif ( is_day() ) : ?>
        	<div class="entry">
				<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

				<?php edit_post_link('Edit this entry','','.'); ?>
			</div>
		<?php else : ?>
		<div <?php post_class() ?>>
				<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
				<p><?php the_time('l, F jS, Y') ?></p>

				<div class="entry">
					<?php the_content() ?>
				</div>

				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>

			</div>

	<?php endif; ?>

		<?php endwhile; ?>

Put this in archives.php:

<?php wp_get_archives('type=yearly&format=custom&before=|&after=|'); ?>

I also had to edit the get_archives function. I’m attaching a text file of that code because it’s a little long. To use, paste it into your functions.php (inside opening and closing PHP tags if they’re not already there). Be sure to also include the getarchives_filter function at the top of this page.

Download new_get_archives.txt – version 1.0 posted 01-10-2010


Welcome

Welcome to the revamped cleverness.org. I know there’s many sites out there with information on WordPress, but I use it for clients’ sites at work and on most of my personal sites and wanted a place to record any interesting information I find. I also plan to host any themes or plugins I create here.