Making Sure that Updates Were Applied to a Web Page with HTML Comments

When modifying a website, the effects to the page are usually apparent. But when the changes only affect the backend, how do you know you're not viewing the old page? A successful update results in the same content being displayed as before the changes. Maybe the updated page was uploaded to the wrong location. Let's see how HTML comments can help. [Continue reading]

Maintaining a Hidden Content Archive Within a PHP Page

Do you have content that cycles regularly, such as a news feed, events calendar, etc. If so, there's a good chance that the current entries would serve as useful templates for future updates. "But where do I store these content templates?" Hey, thanks for asking. If you normally delete old information and are unsure where/how to archive it, let's take a closer look at one of the methods described in last week's post (Three Simple Methods for Hiding Website Content Until It’s Ready)—hiding content with PHP comments. [Continue reading]

Three Simple Methods for Hiding Website Content Until It’s Ready

How do you handle content that needs to be temporarily removed from a website? Maybe there is some text that gets recycled on a regular basis or something that hasn't been approved for posting yet. HTML comments could be utilized to hide everything until it's ready to go live. Just keep in mind that the content is still accessible via the browser for those who know where to look. If that's an issue, the information could be moved to a separate file and saved offline…or you could use PHP comments. [Continue reading]

You Haven’t Even Started Blogging and You Already Have a Typo

There are a number of blogs out there which list dates incorrectly. It doesn't help that many of the templates built for popular blogging platforms like WordPress, display the dates incorrectly be default. If you maintain a blog, develop templates, or have ever typed out the date; please stop writing them as October 3rd, 2011. [Continue reading]

Save Paper by Printing Multiple Pages to a Single Sheet with Microsoft Word

My personal preference is to avoid printing whenever possible. It's bad for the environment, it costs businesses money, and I really like seeing my desk. But there are times when printing seems inevitable. Maybe something is needed for a meeting and you won't have a computer—or internet access. There are still ways to reduce how much paper you use by printing more than one page per sheet. [Continue reading]

Using Custom Picture Thumbnails When Sharing Links on Facebook

When posting links to Facebook, the service usually searches the page for images to use along with the post. But Facebook seems to randomly ignore some pictures or fails to see any at all. If this is a common occurrence for the pages you maintain, there is a way to force Facebook to recognize an image. [Continue reading]

Utilizing the Short-hand if() within a PHP String

Until recently, one thing has eluded me when it comes to the Ternary Operator [aka the short-hand if()]. It's easy to assign the resulting value to a variable or to display it on the screen, but how is the short-hand if() used in conjunction with the concatenation character? In other words, how is it used in the middle of a PHP string? [Continue reading]

Getting Your Projects Done Faster by Writing Less Code with the Short-hand if()

Have you coded a simple if() construct that sets a variable to one of two values and thought to yourself "Five lines of code; there should be a better way?" Okay, maybe it's just me. Either way, let's take a look at the Ternary Operator [aka the short-hand if()]. [Continue reading]

Why You Should Utilize Separate Accounts when Managing Multiple Websites

When setting up accounts for your job with services like web hosting, Google Analytics, etc., don't be tempted by the "it will be convenient for me now" argument. If you manage multiple websites, it may be easier to have all your Google Analytics reports under one Google account for example, but what if you need to split those websites up for some reason? If another developer takes over a website, will it be easy to turn over the keys? As in turning over the source files and account information…not emotionally. For that, you might need counseling. [Continue reading]

Condensing if() Constructs to Improve the Scanability of Your Code

In a previous post, we went through the typical setup for the if() construct. The good thing (or bad) is that there's a lot of freedom when it comes to writing code. You could for example write the entire if() construct that contains dozens of lines of code and never use a line break. You could, but I wouldn't necessarily recommend it. However, there are other non-"standard" ways of writing out your if() constructs. [Continue reading]