Popular Posts
All posts ordered by popularity
jQuery Add Another Image Link
This code snippet is taken from my plugin, User Submitted Posts. It displays a link that users may click to add another file-upload input field.
Auto-Height for Ajax-Loaded Content
Here is a jQuery function for automatically setting the height of Ajax-loaded content.
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.
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.
JavaScript & jQuery: Add Style to Fragment Identifier
It’s easy to style a <div></div> by targeting its ID. But what if you only want to add style when a specific fragment identifier is targeted via the URL? So for example, your page at /about/ has a table with all the data. When visitors arrive directly at /about/, no extra styles are added. But […]
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.
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.
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.
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.
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.
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.