Popular Posts
All posts ordered by popularity
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.
Auto-Height for Ajax-Loaded Content
Here is a jQuery function for automatically setting the height of Ajax-loaded content.
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.
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.
WordPress Change Default Number of Displayed Posts
By default, WordPress displays the same number of posts for the home page (when it is set to display posts) and all types of archive views. To change the default number of posts displayed for any specific view, you can add this simple function to your theme’s functions.php file.
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.
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.
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.
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.
Display All PHP Errors on Screen
When working on a PHP project, I usually log any errors to a file (error log), but on some projects it’s necessary to display any errors right there on the page. Here is the code that I use to make it happen.
Truncate Database Table
Quick SQL code snippet that enables you to truncate any MySQL database table.
Affinity Photo: Transparent Gradient
I switched from Photoshop to Affinity Photo several years ago. Although the overall image editing process is very similar to Photoshop, there are some things that Affinity Photo does differently. For example, doing a simple gradient transparency. Seems easy but it took me quite a while to figure out how to do it. So am […]