Skip to content

Posts Tagged ‘snippets’

Modify a Custom Post Type after it’s been registered

Today I was tasked with adding functionality to an existing custom post type. The problem was, the CPT was being registered in a plugin which I could not edit. After some digging, I found there’s a filter for that (found in post.php) which allows you to modify a custom post type, after it’s been registered some other…

Read More

Get a WordPress Category ID

I rode the struggle bus pretty hard on this one today. I needed to ignore the “featured” category in a loop, and to do so, WP_Query() requires the category ID. Luckily, I found a handy function: get_term_by();

Read More

Lock down the WordPress Dashboard

Because of the recent increase in attacks on WordPress, we were recently chatting about locking down /wp-admin and wp-login.php. We discussed the Limit Login Attempts plugin, which works really well. If a user fails to login after a certain amount of attempts, they are blacklisted for a period of time.

Read More

i18n vs L10n

i18n stands for “internationalization” L10n stands for “localization” Both are numeronyms, or “number based words”. The numbers come from the number of characters in between the “i” and the “n”. You can read all about their storied history here and here. How i18n (internationalization) works in WordPress By wrapping some text in a nifty PHP…

Read More

How To: Install LAMP on Ubuntu

My brother called to talk about moving his company’s web development and testing environment in-house. They had already downloaded Ubuntu, but didn’t know how to get Apache, MySQL, or PHP installed. I sent him one command and 5 minutes later, they had a fully functional LAMP stack running.

Read More