WP Development

Writing a Plugin That Can Be Localized by WPML

Writing a custom plugin that can be translated by WPML (WordPress Multilingual) using .mo files is actually quite simple once you figure out how to generate the .mo file. My first attempt to internationalize my plugin with WPML however was less than successful, WPML would not localize my plugins text strings. I knew my .mo file was correct, and could be loaded by WordPress because when I set WPLANG to my target locale in wp-config.php,…

Hide Certain WooCommerce Sub-Categories in Catalog

WooCommerce provides some coarse control over displaying sub categories in your shop/category pages with the “Show subcategories on category pages” and “Show subcategories on the shop page” options on the WooCommerce > Settings > Catalog > Catalog Options section. These controls are all-or-nothing though: show all subcategories on the category pages, or show all subcategories on the shop page. If you want finer-grained control, for instance displaying only certain subcategories on the shop or particular…

SkyVerge WooCommerce Extensions

WordPress Pretty Category Permalinks Broken and Fixed

This is probably another one of those situations that applies only to me, but just in case someone else out there happens to have this same broken permalink issue, I’ll describe what happened to my site, and how I fixed it. The specifics of my setup were: WordPress 3.4.1, WordPress SEO 1.2.5, and the custom permalink structure /%category%/%postname%/. The problem that someone thankfully alerted me to (gotta get back in the habit of checking Google…

WordPress development tutorials

How to Create a Custom WordPress Post Type With Image Uploads

This article details one method of creating a custom WordPress post type with the ability to upload and attach images using the built-in WordPress Media browser. This piece does not cover all the details and nuances of creating a custom post type, as this is covered well elsewhere. In addition to highlighting the most important methods and code required, I have attached a fully functional demo plugin which you may feel free to download and…

WooCommerce reviews + tutorials

Create an Overrideable WooCommerce Template File

Sometimes when developing a WooCommerce plugin you want to output a snippet of HTML, and do so in such a way that the content can be easily overridden by a theme. It’s part of the process of crafting a well-engineered, customizable plugin. The best way to achieve this is by using WooCommerce’s own templating mechanism, and what once took some effort and some filters is now a snap thanks to one of the recent WooCommerce…

WP Development

How to Add a WordPress Plugin Action Link

I always prefer it when plugins make it as easy as possible to find their configuration page. When I install a new plugin the last thing I want to do is hunt around for some hidden menu item, I want to play around with my new toy! And what better place to link to a plugin’s configuration than right from the admin Plugins page where the plugin is activated, deactivated or (the horror!) deleted. These…

WP Development

Debugging WordPress

The following are some techniques I use nearly every day for debugging WordPress and WooCommerce, and can be used for plugin or theme development equally. Echoing or printing to the screen will only get you so far when debugging, especially in a complex framework like WordPress; to really understand the code flow, and to trace and fix issues, you need to be able to log messages to a file. For this WordPress makes use of…

WooCommerce extension updates & releases

WooCommerce Sequential Order Numbers Pro Released

Today marks the release of the WooCommerce Sequential Order Numbers “Pro” plugin, the first of many practical and useful WooCommerce extensions to be released by Fox Run Software. If you don’t like the essentially random order numbers that WooCommerce uses, and you perhaps want to customize them a bit as well, then this plugin could be a good fit for you. The Pro version of the plugin builds upon the limited functionality of the free…