All posts ordered by popularity
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.
How I respond to “translation spam”, which happens when greasy organizations ask permission to translate your script, extension, plugin, etc.
Super useful trick for customizing error logs when working with PHP.
Internet Explorer has a nasty habit of displaying honking blue borders on linked images. This post shows a quick way to disable them using a slice of jQuery.
Quick SQL code snippet that enables you to truncate any MySQL database table.
If you try to log in to some of my WordPress-powered sites via the WP Login Page, you will be met with a 403 “Forbidden” response. For sites where I am the only registered user, I lock things down to prevent endless waves of drip force attacks. It really helps to reduce server load, conserve […]
Here is a nice copy/paste .htaccess snippet to help block SQL-injection attacks. It can be added as-is to your .htaccess file to help protect against SQL injection and other types of malicious activity. This code is a not a replacement for proper data sanitization, but it does help to add another layer of security to […]
I’m surprised that WordPress doesn’t provide a function for getting the site creation date. Knowing when the site was set up can be useful for all sorts of things. Copyright dates. Bragging rights. Whatever. If you want to display the date your site was first installed, here is one way to do it.
Depending on your WordPress configuration, plugins, and so forth, your site may be suffering from “self-pings”. Self-pings are pingbacks from your own domain, which are not necessary and look kind of silly displayed alongside other, actual pingbacks. If your site is haunted by self-pings, here is a quick code snippet to stop them.
If you are using Apache server, you can stop an attack by getting the IP address of the attacker and then using it to block or redirect all of their requests. Normally I just block the requests using either Deny or Require directives (depending on Apache version), but sometimes it’s fun to redirect the attacker […]
Here is how to cd (change directory) into an external drive using Terminal on Mac computers. The trick is knowing the name of the drive and where it is located. On Macs, all connected drives (including hidden drives) are mounted/located under the /Volumes directory. So we can use this information to get the names of […]
I’ve posted before about fixing weird default browser styles. It happens all too often. Well-intentioned browser developers taking liberties on the page with things like CSS styles. This post shares a quick code snippet that fixes the Chrome browser’s new “rounded corners” style that now is applied to form elements like buttons and inputs.