squareworld Code stuff

I've been designing websites since 1995, but had never strayed further than HTML, CSS, and drop-in scripting add-ons that I could usually fiddle with to fit my needs. In 2006, one of my websites was falling apart under the load of hundreds of posts. It was time to find a new blogging engine and luckily I found WordPress. It worked well for us for awhile but eventually we were ready to take our website to the next level—which meant straying from simple templates. With the right knowledge you can do just about whatever you want with WordPress. So recently I set out to learn PHP and JavaScript and it has really changed the way I create pages now. The past 15 years almost seem wasted in that I should have learned this earlier! I relied heavily on books and websites to teach me what I needed. Luckily there are a lot of people out there willing to help out beginners and share what they know. Now I feel I'm at a point where I can give a little bit back. I don't have the time to check out support forums and I can't really give out email advice. But I can post a few things here that might help out other web developers trying to solve issues they have that I went through.

Please note that I am admittedly relatively new to all this, having been doing WordPress editing for just a few years and PHP and JavaScript less than that. So I'm not going to pretend there aren't better, cleaner, or more efficient ways to do some of these things out there. All I can tell you is what I've done on my sites. Also, as I mentioned above, a lot of what I have learned came from others. There are a lot of sites out there where you can find out how to do things. I'm not going to just copy and paste interesting stuff from there to here. The following is code I either created or adapted from others to serve a specific purpose on one of my sites that might also be useful to others.