Category PHP

Simple MY_Model class for all models in Codeigniter

Codeigniter’s model structure is a bit complicated and doesn’t quite work in the ways you would think it should. However, I have extended the default model class to include some helpful functions which should be available to all models. It is by far the easiest and most comfortable way to use models in Codeigniter that [...]

No Comments

Simple layouts/template system for Codeigniter

Codeigniter comes with a nice way of dealing with views and such as part of its MVC structure. However, it gets a bit more complicated when you want to replicate layouts, for instance if you have a header and footer, and don’t want to have to copy the code for this into lots of different [...]

3 Comments

Custom WP_Query and loop with pagination – without plugins

This is very easy to do, and yet is so difficult to find info on around the net. Follow this guide to build functional custom WP_Querys and loops with the correct pagination using WordPress’ built in functions. Firstly you need to define your WP_Query. Importantly you don’t want to use the $wp_query variable. This may [...]

11 Comments

How To Fix Error: “Warning: session_start() [function.session-start]: open(/path/to/file, O_RDWR) failed: Permission denied (13) in /path/to/script.php on line __LINE__”

I recently had this error. There was lots of information on the internet, but nothing that could help me with my specific case. It would appear that a session file is not accessible anymore and this is causing the error. Aside from the error itself, I was only seeing this error on one particular browser [...]

3 Comments

Twitter