Category Archives: Code

Prevent Refresh from Adding Another Product in WooCommerce

Prevent items from being mistakenly added to the cart multiple times. Mountain America Jerky uses the WooCommerce eCommerce plugin for WordPress, and they were having an issue: when users added a product to their cart then refreshed, the item was being added … Continue reading

Posted in Code | Tagged , , | 1 Comment

Paginate Links in WordPress Link Manager

Links are not a first-class citizens in WordPress In developing the a website for professional genealogists, I was tasked with creating link directory functionality in WordPress. I didn’t want to install some big plugins; I wanted to use the Links Manager … Continue reading

Posted in Code, WordPress | Tagged , , , , | 10 Comments

Storing Data in WordPress Plugins – A Quick Rundown

Coding better WordPress plugins As I’ve worked with WordPress plugins, I’ve learned new ways of working with WordPress. WordPress has tons of built-in functionality that is very useful and easy to use once discovered. I am by no means a … Continue reading

Posted in Code, WordPress | Tagged , , , , , | 1 Comment

Auto-Optimize WordPress Database without a Plugin

These horses are somehow not cool. Speeding up your blog is. I am working on a WordPress project that has a pretty heavy database, and I want to be able to auto-optimize the WordPress database. Even though they are integrating … Continue reading

Posted in Code, WordPress | Tagged , , , , , , , | 6 Comments

How to Prevent Loading WP-DownloadManager’s CSS File

If you want to disable the WordPress plugin WP-DownloadManager‘s download-css.css file from being loaded, add the following code to your functions.php file: remove_action(‘wp_print_styles’, ‘downloads_stylesheets’); Alternatively, if you would just like to use your own stylesheet, you can add a file … Continue reading

Posted in Code, QuickTip, WordPress | Tagged , , , , , , | Leave a comment

Add a Store Catalog XML Sitemap to the Shopp Plugin

The Shopp default RSS/XML/Google Base solution was not enough. I needed to have a Google Base feed that featured all the store products. For some reason, the recommended process wasn’t working for me. It was either showing only recent products, … Continue reading

Posted in Code, Shopp | Tagged , , , , , , , , | 5 Comments

Simple Taxonomies Formatting — Improve the Plugin’s Code Output

I’ve been using Joost de Valk’s Simple Taxonomies plugin for a couple of projects, and I’ve been very disappointed by the formatting of the terms output code. When configuring the plugin, you have the option of choosing “Add terms to … Continue reading

Posted in Code, WordPress | Tagged , , , , , , , , | 2 Comments

How to Display a Random Testimonial or Post in WordPress

Set up a testimonials category — no need for a plugin. There are a couple of plugins designed specifically for testimonials, but I didn’t want to use them; they use their own databases, and don’t keep with WordPress’ simplicity. If … Continue reading

Posted in Code | Tagged , , , , , , , , , | 28 Comments

Get Adjacent Images – More WordPress Functions

WordPress, just get the adjacent image links. I’ll tell you what to do with them! WordPress is normally great about providing functions that have a return and an echo version.  In WordPress, if a function has the prefix get_, then … Continue reading

Posted in Code, WordPress | Tagged , , , , , , , , | 3 Comments

WordPress Digg Shortcode Function – As Seen on WordPress.com

When moving from WordPress.com, my Digg shortcodes broke. I wanted a simple way to transition my Digg chicklets to a WordPress.org installation. I created a function that does nothing special, except for reproducing the Digg shortcode functionality on WordPress.com. All … Continue reading

Posted in Code, WordPress | Tagged , , , , | 2 Comments