Slushman

Code Samples posts

How to Pass Variables with get_template_part

January 11, 2017

I've had several occasions where I needed to use variables in a file called using get_template_part, like one of the files in the template-parts folder in _s…

How to Link to the Customizer

June 02, 2016

I recently needed to link to a custom panel in the Customizer and had to figure it out. Devin Price pointed me in the right direction, but I ended up looking…

How to Change the Featured Image Labels

November 03, 2015

When creating a site for a client or creating a plugin, I've found its helpful to customize things as much as possible to the intended usage. This is especially…

Avoiding get_theme_mod Errors

April 16, 2015

If you're getting an error related to get_theme_mod , its most likely from how you're checking if the returned result is empty. Most developers will probably…

SimpleMap Shortcode Reference

January 08, 2015

I've been using a plugin called SimpleMap for clients recently. SimpleMap creates a custom post type for managing locations (think store locations) and displays…

Inline SVG the Sane Way

November 10, 2014

Like everyone else these days, I've totally jumped onboard  the SVG train . They're scalable and easy to use. If you use inline SVG, they are style-able and…

Adding a Custom Class to a Submit Button

January 17, 2013

While you can hand-code the HTML for a submit button in a form, WordPress has a nice function, submit_button() , that echoes the correct code for you. For a…

Returning a submit button

January 17, 2013

In WordPress, the submit_button() function echoes a submit button. However, there are occasions where one might need a submit button, but not echoed. Like when…

How to Add a Class to a Metabox

September 08, 2012

While developing a new plugin, I needed to toggle the visibility of some metaboxes. The visibility of each metabox depends on the selected radio button in…

How to Set Dashboard to Use One Column

August 11, 2011

I'm working on a plugin where I need the Dashboard to have one column for all users. While I could log into every user and change their Screen Options to one…

Find User ID by User MetaData

July 25, 2011

I just wrote this useful function and thought I'd share. I'm working on a plugin for my employer, Belmont University. I needed to find a user's ID by the user…

View all categories