Tag Archives: php

Web safe color list with PHP

Needed to create a list of the web safe colors for another site of mine. Yeah, I know that web safe colors are outdated. But it was still something I wanted on the site. Typing in 216 hex color codes … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Trouble with textarea in TinyMCE Editor

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 … Continue reading

Posted in WordPress | Tagged , , , | 2 Comments

Get WordPress posts with one of two meta key values

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 … Continue reading

Posted in WordPress | Tagged , , | Leave a comment

Converting column number Excel column name

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. … Continue reading

Posted in Programming | Tagged , | Leave a comment

WordPress, Custom Taxonomy, and “An unidentified error has occurred”

Working on a plugin today, part of which includes a custom taxonomy, and came across a snag today. Got the taxonomy added, along with the custom post type it was associated with. The meta box showed up just like it … Continue reading

Posted in WordPress | Tagged , , | 7 Comments

Regex to replace multiple spaces

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 … Continue reading

Posted in Programming | Tagged , | 1 Comment

Hiding the “Welcome to your new WordPress site” message

Sitting here working on setting up a WordPress network and hit a snag. New sites have a giant “Welcome to your new WordPress site” message when someone logs in for the first time. Now, I’m not against the message; and … Continue reading

Posted in Blogging, Programming | Tagged , , , , | Leave a comment

Should add new comment be above existing comments

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 … Continue reading

Posted in WordPress | Tagged , , | 1 Comment

PHP, __FILE__, and eval()

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 … Continue reading

Posted in Programming | Tagged | Leave a comment

Sorting on version numbers with PHP

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 … Continue reading

Posted in Programming | Tagged | 1 Comment