Popular Posts
All posts ordered by popularity
PHP Stringify Formatted Text
This code snippet takes a string of text and removes all carriage returns, new lines, and tabs, replacing any matches with a simple blank space. An ideal way to “stringify” a potentially formatted lump of alphanumeric text.
Truncate Database Table
Quick SQL code snippet that enables you to truncate any MySQL database table.
WordPress: Display all comment fields when user is logged in
By default WordPress hides the Author/Name, Email, and URL fields on comment forms when the user is logged in. This is because WordPress automatically gets the related information directly from the user profile. But what if you need to do some testing or troubleshooting and want to display all the fields? Here is a plug-&-play […]
Replace JavaScript Smooth Scroll with CSS
In the past, we had to resort to JavaScript to smoothly scroll to on-page target destinations. Fortunately things have evolved and we can now save some extra kilobytes by replacing (relatively) heavy handed JavaScript and jQuery techniques with just a few bytes of CSS.
jQuery Fade Out Element
Here is a simple jQuery technique to fade out any element on the page. It uses jQuery’s .hide() method to animate the fade-out of the specified element.
Nice little input button with CSS
Just making a note of the CSS used to make a nice little input button, leftover snippet from a previous project.
Get WP, PHP, and SQL Info
Here are some sweet code snippets for getting various types of server information. Includes more functions for getting and/or checking various types of WordPress, PHP, and SQL data. Strictly plug-&-play for quick reference and copy/paste usage.
WordPress Change Excerpt Length
This code snippet is SO easy.. check it out if you want to change the default number of words included by default in WordPress excerpts.
SMS Text API Services
I’ve been wanting to build a “server uptime” app that optionally sends a text message to alert users if certain conditions are met. I can build the app part myself, but needed a solid way to send the SMS messages. In my pursuit of a solution for this, came across several reasonably priced solutions. Thought […]
Disable WordPress Automatic Updates
In case you haven’t noticed, WordPress auto-updates its core files by default. Neat but not always desired. Here is how to disable auto-updates with a few lines of code.
Filter pre tags in bbPress
A couple of functions used at htaccessbook.com to enable unescaped/unencoded pre and code tags in bbPress forum posts.
WordPress plugin redirect when settings saved
This technique is a bit esoteric and mostly for my own reference. Feel free to try the code if it makes sense to you; otherwise, maybe just move on to the next code snippet. Just not enough time in the day to explain everything.