A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

A simple set of templates for any project

Now that modern browsers are starting to support some of the really useful parts of HTML5 and CSS3, it’s time for our best practices to catch up, and we thought we’d put our files out there for everyone to use. By no means do we see this as the One True Way to start every […]

jQuery Auto Complete input field

TextExt is a modern jQuery plugin for improving the functionality of text input fields as tag input and autocomplete.

jQuery Organization Chart

jQuery OrgChart is a plugin that allows you to render structures with nested elements in a easy-to-read tree structure. To build the tree all you need is to make a single line call to the plugin and supply the HTML element Id for a nested unordered list element that is representative of the data you’d […]

Breadcrumbs for Taxonomy for a Custom Post type

This is what I came up with to display the category, or rather a custom taxonomy, of a single posttype page of use in a breadcrumb. The taxonomy I used is ‘smg-logo-brand’ and the terms slug where ‘kcrg’, ‘the-gazette’ and ‘sourcemedia.’ I compared the terms associated with the post to that in the URL to […]

WP-o-Matic breaks WordPress Related Links

function adminInit() { auth_redirect(); // force display of a certain section $this->section = ($this->setup) ? ((isset($_REQUEST[‘s’]) && $_REQUEST[‘s’]) ? $_REQUEST[‘s’] : $this->sections[0]) : ‘setup’; // if (isset($_SERVER[‘HTTP_USER_AGENT’]) && (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘MSIE’) !== false)) // die(‘Please switch to Firefox / Safari’); wp_enqueue_script(‘prototype’); wp_enqueue_script(‘wpoadmin’, $this->tplpath . ‘/admin.js’, array(‘prototype’), $this->version); if ($this->section == ‘list’) wp_enqueue_script(‘listman’); //if ( WPOTools::isAjax() ) […]

SlidePress Plugin Redirect Bug

When clicking on settings links for the SlidePress plugin in a multi-user WordPress site the plugin would redirect to /wp-admin/?c=1 for each domain except the parent site.

[code lang=”php”]function get_current_user_role() { global $current_user, $wp_roles; $role_names = $wp_roles -> get_names(); /* UPDATED 11/2/2010 9:21 AM * by */ // modified [start] reset($current_user->roles); $first_key = key($current_user->roles); […]

is_home() not working in my WordPress plugin

When using is_home(), is_category(), is_page() etc. in my WordPress plugin that displays category-based ads, they kept returning NULL.

My problem was that I was calling this these function directly in my plugin. I resolved this by adding these call to my adHeaderSetup() function and setting the hook add_action(‘wp_head’, ‘adHeaderSetup’);

USPS Web Tools

I was trying to add the USPS API into osCommerce. I received the following error when adding this shipping module:

RateV3 is not a valid API name for this protocol

This is because when you create an account for the Web Tools at USPS you only have access to their test server. The USPS test […]

Use Python to Save an FTP Directory List to File

Written for Python 2.6

#!/usr/bin/python import ftplib ftp = ftplib.FTP(“”) ftp.login(“username”, “password”) ftp.cwd(“path/path”) data = [] ftp.dir(data.append) ftp.quit() outputFile = open(‘dirList.txt’,’wb’) for line in data: outputFile.write(line + “\n”) outputFile.close() […]

Using Python to replace spaces with underscores in filenames.

Python can be used on Window, Linux and Mac. It just a simple install.

download code

#!/usr/bin/python import string import os import re # task: # loop thur input directory # look for .pdf # replace space with underscore # rename/move to output directory inputDir = “./” # Current directory outputDir = “./new_location” for filename […]