Advertisement

Quick Tips

11|27

Styling WordPress Comments

Styling the WordPress comments can be a pain if you don’t know what you’re doing. You have to wade through functions and files to finally get what you want.

Luckily, we can write our own comment function, using our own code, to make styling the comments 100% easier and 50% more fun

Continue reading

11|17

Simple Templates: Easy as Pie

The Problem

I’m working on a project and have to generate the same template on 4 different pages. I was also using javascript to create the same template on the fly. Needless to say this wasn’t the most efficient way of doing things because if I needed to change 1 aspect of the template, I needed to edit 4 different files.

I tried to write a little function, inspired by CakePHP, that would take an array of information, open up a template, replace any text and then return the new content. Continue reading

11|05

PHP Shorthands: Write Less Code!

Writing a lot of code can get very tedious especially when you are in hour 6 of your work day. I’m always looking for way to write less code so i’m going to share a few tips that I use on a daily basis. Continue reading

10|22

How To Tame Your PHP Error Logs

I recently watched a quick Screenr screencast by Jeffrey Way about logging your errors in PHP to a text file. Needless to say, I was a little bit inspired.

It was only a quick 5 minute tutorial so it didn’t go into much detail and after implementing it into one of my projects it needed some tweaking.

The main problem was there was the potential for your site to create thousands of indistinguishable error logs. My solution was to create folders to house daily log files. This makes your error logs live inside a nice folder structure broken down by year, month and day. Continue reading

10|05

How to Include All Your Functions In 3 Lines of Code

Functions are amazing. Working with huge function files is not.

I like to group all my functions into different “function files” to keep everything nice and clean. For example, I’ll keep all my functions that clean up various strings or elements in a clean.php file.

This is great because I don’t have to scan a 50000 line PHP file to find the function that I’m looking for.

As your application grows, the number of function files may grow with it. This can pose a problem. Did you remember to include the new function file in all necessary scripts?

Continue reading

10|01

A Crash Course in CSS

I have a friend who is wanting to get into HTML and CSS. He has a good understanding of HTML tags, but didn’t know anything about CSS.

I wrote up this quick HTML file as a crash course in CSS. I’ve decided to share it with everyone, maybe it’ll help at least one person.

Not bad for a 1 minute tutorial, should be a new record!

Continue reading

09|30

Partially Functional

PHP functions can be extremely useful if you have a chunk of code that you plan on using multiple times in your scripts. Functions keep everything all neat and tidy and in the case you have to make a change, you only have to edit one place instead of multiple places.

Continue reading

09|28

Combine Your CSS Files with PHP

I like to work with multiple CSS files. I also like to limit the number of HTTP request my site/app is making.

I’ve seen a couple methods on the Internet of using PHP to combine your files and decided to use some of those methods in my own little script.

Basically this script lives in your CSS folder. It grabs every file, opens it up, takes the content and then mashes it all together. It also takes our new content and strips any comment and white space to create a new compressed file.

Continue reading

09|26

Slim WordPress Stylesheet

The wordpress style-sheet can be a little bit daunting/confusing especially if you’re new to wordpress. It’s broken up into multiple sections with repeating blocks of elements.

I’ve stripped it down and this is the CSS I use when starting with a wordpress site.

It’s valid CSS but take it with a grain of salt as it’s not for everyone. It’s helped me and I hope it helps you!

Continue reading

09|19

Submitting a form with Mootools and PHP

Submitting a from can sometimes be a daunting task especially with the whole “page refreshing” web 1.0 way of doing things.

In this screencast we are going to cover submitting a form with mootools without having the page refresh.

Continue reading