Trouble with textarea in TinyMCE Editor

Posted by & filed under WordPress.

Came across an issue where the TinyMCE editor inside WordPress was stripping out <textarea> tags as I switched between the HTML and Visual editors, and the page I was working on needed a textarea. After digging through Google I came across a pretty good reason. A textarea inside another textarea can cause problems so they’re… Read more »

Get WordPress posts with one of two meta key values

Posted by & filed under WordPress.

Been working on a project for the past couple of days, and spent a bit of time this morning trying to get WordPress to do something. As usual, WordPress came through. Just took me knowing what to enter. What I’m working on is a plugin that adds to the <head> section of a page based… Read more »

Converting column number Excel column name

Posted by & filed under Programming.

Quick little snippet needed while working on a web app that exports to an Excel worksheet. What I needed was a way to convert column numbers to the lettering that Excel uses. So, for example, column 27 would become AA. Found a bulk of the solution at Stack Overflow. Logic wasn’t exactly what I was… Read more »

Regex to replace multiple spaces

Posted by & filed under Programming.

Normally I just don’t worry about this since I’m usually building websites and HTML takes care of merging multiple spaces. But it comes up occasionally. And since it’s just a quick regex replace, it’s pretty quick to merge multiple spaces. Piece of cake. It looks for any places that there is 2 or more spaces and… Read more »

Should add new comment be above existing comments

Posted by & filed under WordPress.

Had a thought while scrolling to the bottom of a WordPress post with 250+ comments. Does having the add new comment form at the bottom of a page that long lead to fewer comments? Really, who is going to scroll that far? So I’m going to play around a bit here and move the comments… Read more »

PHP, __FILE__, and eval()

Posted by & filed under Programming.

Came across an odd error last week. And by odd, I mean that Googling for the error message only turned up one page. One of my scripts was using eval as a way to semi-protect the code. Yeah, not a great solution. But it’s not possible to install software on all of the users’ servers… Read more »

Sorting on version numbers with PHP

Posted by & filed under Programming.

Needed a quick way to sort on version numbers, and PHP has a usort function that makes it pretty easy. You’ll need an array to sort and call the usort function with a callback. Now the callback. We’re going to use version_compare. Only minor quirk is the * -1 to flip version compare. I wanted… Read more »

Amazon Images plugin for WordPress

Posted by & filed under Blogging, Programming.

Every now and then I like to link to Amazon products, along with an affiliate tag. Nothing spammy. But I figure if I’m going to link to something that they make money off of, I might as well try to make a bit as well, right? Downside is that the link builder inside Amazon typically… Read more »