Categories
Web Development

Formatting Phone Numbers with PHP

When adding a phone number field to a form, it’s nice to format it (if it isn’t already). This doesn’t replace anything you would do to validate your form via Javascript. But it does create that little extra bit of uniformity, even if it is slightly redundant.

Categories
Web Development

Adding the Bootstrap “active” class to a WordPress Menu Item

Working with WordPress and Bootstrap, you might be frustrated with the built in menu options. There isn’t an easy way to tell WordPress to swap out the ¬†current-menu-item class with bootstrap’s active class. Fortunately for you and me, there’s jQuery for that. Just a little dab will do ya. jQuery(document).ready(function () { $(“.current-menu-item”).addClass(“active”); }); This […]

Categories
Web Development

Using PHP Classes and Functions in WordPress

Creating custom functions in your WordPress template’s function.php file is a regular thing for many of us. What you might not know is how easy it is to wrap them in a class, or even why you would. Wrapping them in a class keeps them both organized and self-contained from other functions that may have […]

Categories
Web Development

Role Based Profile Fields in WordPress

I recently set out to customize WordPress profile fields for a specific role. You may want to have custom fields for users, but have different fields for different roles. For example, Authors may need some additional contact information, while Subscribers need only some basic fields. The concern I had was wether or not an Admin […]

Categories
Web Development

WordPress File Uploads Checked By MIME Type

Building a custom HTML form for WordPress is something I do fairly regularly. When adding an upload form, it’s important to check for allowed file types. You wouldn’t want anyone uploading a malicious PHP script, right? Wouldn’t it be great if WordPress did that for you? Of course it would.

Categories
Web Design Web Development

Customizing The WordPress Registration Form

Often times, people want a way to modify the look of the registration form page in Wordpress. However, this desired outcome is often misplaced. What most people want to do is simply place the form on a page, such as the home page or special registration page.

Categories
Web Development

The Ugly Bootstrap File Input Type

Bootstrap has a way making a lot of HTML elements look good, right off the bat. But the day finally came when I had to face to inevitable: The . This is the red headed stepchild of Bootstrap (and browser makers). Browsers render this element differently from each other, making it nearly impossible to look good across the board.

Categories
Web Development

PHP Web Form Snippets and Tools

When creating php web forms, there are a few things I always like to have in reach. Don’t expect anything groundbreaking in this list of tools and code snippets. I will also try to update the list as time goes on.

Categories
Web Development

Understanding the WordPress Quick Edit Custom Box

Alright, I have to confess. This took me some time to wrap my head around. It also seemed like a lot of people were having the same problem. The question is “How do I add custom post meta fields to the quick edit function in WordPress?” For some reason, I had a hard time finding […]

Categories
Web Design Web Development

Set a Container to the Window Height with jQuery

A common issue with CSS is finding the best way to set an¬†element, such as a div, to stretch from the top of the screen, to the bottom of the screen. You can do this with positioning. Sometimes, though, you want the div to start from after the banner, navigation, or something else. This creates […]