Tag Archive for: wordpress

WordPress Must-Use Plugins

20 Apr
April 20, 2013

At this point in time, WordPress remains the easiest-to-use “CMS” available to us, so I end up developing quite a few sites with it. Somehow, there is this great feature I’ve never heard of until a few weeks back, so I thought I’d share with the class.

WordPress has this feature called “Must Use Plugins“, aka mu-plugins. They go in the directory /wp-content/mu-plugins/ which does not exist by default. WordPress will load every .php file in that top level directory, before regular plugins. In my efforts to write less crappy code on WordPress, this directory has proved invaluable. However, rarely do you want a bunch of .php files in that directory. Normally, you’d want a system more like the regular plugin directory where each plugin can be a file OR a directory.

I wrote up a little proxy loader script that accomplishes this. Just save as /wp-content/mu-plugins/proxy-loader.php or something, and it will load either /wp-content/mu-plugins/<plugin-name>/<plugin-name>.php OR /wp-content/mu-plugins/<plugin-name>/plugin.php if those files exist. The plugin is available via GitHub.

New Premium Plugin Available

22 Dec
December 22, 2011

Easy Custom CSS Stylesheets

I’ve been working on a new plugin for the past week or two, writing documentation for it, and testing it quite extensively. It finally got accepted on CodeCanyon, a marketplace for premium plugins and code.

My plugin is called Easy Custom CSS Stylesheets, and it allows you to create unlimited stylesheets which are stored in the database and link them to your site, or attach them to specific pages, posts, or special pages (Category page, home page, login page, etc). This eliminates the need of modifying your theme source which breaks the ability to update the theme and is generally a hassle.

I plan on adding the ability to do the same thing with JavaScript to the plugin soon as well. The plugin includes a JavaScript based code editor, complete with syntax highlighting, key binds and line numbers. You can even link to remote stylesheets, useful for importing fonts from Google Web Fonts or Typekit.

You can purchase it for $14 over at CodeCanyon.

WordPress 3.1

30 Nov
November 30, 2010

WordPress 3.1 Beta 1 was just released and I’m already running it on one of my sites. It’s fantastic, they fixed and added quite a few nice things

  • We have the ability to query multiple taxonomies now
  • Custom post types can have archive/index pages (Using the template post-type-archive-{$post_type}.php)
  • The link dialog box lets you search all post types for the item you wish to link to (Finally)
  • The admin has markup has been cleaned up and more AJAX added (Sortable columns, woot)
  • There is an admin bar on the front-end of the site like WordPress.com (They beat me to it, I was actually working on it)

I’m quite excited for the final release, but all seems to be working well so far.

In other news, Gravity Forms 1.5 is coming out soon. I’m a huge fan of Gravity Forms and use it on all of my sites now. 1.5 adds some nice features like multi-page forms and the ability to integrate with PayPal in some awesome ways. For those of you who haven’t heard of it, go check out Gravity Forms now, it blows away every other form plugin for WordPress. It’s SUPER easy to use, so much so that clients can create complex forms with no training. It logs entries to the WordPress admin, lets you set up complex notifications, and much more. It’s definitely worth the $40 for a single license or the $200 for a developer/unlimited license.

Thesis 2.0 is building up a lot of hype but still isn’t out yet, although Thesis 1.6 is doing what I need it to for now.

Google Chrome Dev Channel (9.0) is faster than ever and supports several new features such as the HTML voice input type. The upgrade brings Linux Chrome more inline with the versions available for Windows and Mac (Standard Icon and it’s called Google Chrome not Chromium Browser). Check it out today.

Easy WordPress Theme Options

02 Aug
August 2, 2010

For the most up-to-date information visit the plugin page

I’ve been getting really annoyed every time I want to add options to my theme and I have to copy a huge mess of code that just isn’t fun to use. You know what I mean. Most theme developers now include configurable options in their themes, which if you ask me, isn’t super easy.

So the other day I set out to write a class that theme developers could package with their file and have easy access to theme options. It’s as easy as adding my theme_options.php file to an include folder in your theme directory, and then adding this code to your functions.php (Using your option values obviously).

Download my ThemeOptions class

require_once( 'includes/theme_options.php' );

define( 'THEME_NAME' , 'Theme Template' );
define( 'THEME_SHORTNAME' , 'themetpl' );

ThemeOptions::add( 'sample_text_field', 'Its a text field'  , array( 'desc' => 'A description of the theme option', 'type' => 'text', 'default' => 'Default Value' ) );
ThemeOptions::add( 'sample_textarea'  , 'Its a text area'   , array( 'desc' => 'A description of the theme option', 'type' => 'textarea', 'default' => "Text\nTest" ) );
ThemeOptions::add( 'sample_checkbox'  , 'Its a checkbox'    , array( 'desc' => 'A description of the theme option', 'type' => 'checkbox', 'default' => 'enabled' ) );
ThemeOptions::add( 'sample_select'    , 'Its a select thing', array( 'desc' => 'A description of the theme option', 'type' => 'select', 'default' => 'Option 2', 'values' => array( 'Option 1', 'Option 2', 'Option 3' ) ) );
ThemeOptions::add( 'sample_radio1'    , 'Its a radio field' , array( 'desc' => 'A description of the theme option', 'type' => 'radio', 'default' => 'val1', 'values' => array( 'val1' => 'Text 1' , 'val2' => 'Text 2' ) ) );
ThemeOptions::add( 'sample_radio2'    , 'Its a radio field' , array( 'desc' => 'A description of the theme option', 'type' => 'radio', 'default' => 'val2', 'values' => array( 'val1' => 'Text 1' , 'val2' => 'Text 2' ) ) );

Now this may seem confusing at first, but if we expand it out, you’ll see it’s similar to other WordPress functions (I did the code like that for that specific reason):

$args = array(
    'desc' => 'This is a description of the option',
    'type' => 'text',
    'default' => 'This is the default value'
);

ThemeOptions::add( 'option_id', 'Option Name', $args );

And to get a value:

$val = ThemeOptions::get('simple_text_field');

Isn’t that easier that what you’ve been doing? I’ve encapsulated my code into a nice class to make everything super simple. The results should look similar to this (Located in Appearance > Theme Options):

Screenshot of the Theme Options Page

Download my ThemeOptions class

Members Only Menu Plugin

01 Aug
August 1, 2010

Visit my up-to-date page for this plugin

I released my my walker class as a super easy to use plugin (This doesn’t even require you to change your wp_nav_menu commands as it uses a filter to add it). I’ve submitted it to WordPress.org so I’ve linked to it below.

Just install and activate it, and then you can go to a page and mark it as Members Only.

Now featuring full support for wp_page_menu AND wp_nav_menu. Tested on WordPress 2.9+. Also fully compatible with PHP 4+!

Download my super awesome plugin now!