I have been using Laravel quite a bit recently and it's a great framework, which is really good fun to code with. I've just started writing a registration system in Laravel and came across a problem which I felt was worth sharing. I was creating the table and model to store the event details and I found that the Event class caused a conflict with one of Laravel's core libraries. The easy work…
The WooCommerce stock status (In Stock, Out of stock) will only show if WooCommerce is managing the stock for you. I was working on a project and the client wanted the ability to manually set if the product was in stock or not. The code snippet below will allow you to show the stock status for both managed and unmanaged products. Just copy and paste into your themes functions.php file. // Show the…
I've always found it annoying that you can't set a different ul bullet colour through CSS. It should be as simple as: ul { color: red; } li { color: black; } But unfortunately CSS will render both black. I came across this again the other day in a project, and I was just about to fire up photoshop and create another bullet-point image. Before I had a thought; why not use the css :before selector.…
Have you just updated your local of WordPress and its now all broken on MAMP, I've had this problem a few times now so thought it would be worth sharing how to fix this. The problem is caused by the load-scripts.php file being compressed with zlib , I first did as suggested on this stackoverflow question . But this still didn't fix the problem after some looking around I noticed that MAMP zlib…
As a web developer you learn that there is nothing more important than keeping regular backups of your databases. I've created a little bash script to help with Backing up MySQL databases for this I'll use mysqldump. Mysqldump is a nifty little utility that lets you dump the contents of a database to a file, so I use this to create a little bash script that will backup the database at regular…
I've found that one of the best parts of putting my site live in May earlier this year, was being able to start again and use what I had learnt to improve my site. Today I have launched my new design and I couldn't be happier with it. I think as a web developer/designer it's easy procrastinate to much over your own site. When we work on a site for a client we have a specification and deadline to…
The other day I found myself needing to insert into an array at a given position, so I wrote this little function. For example if you have pulled a list of posts from a database and are going to loop through these to output the HTML, but want to insert an advert after the third post, you can simply insert into an array at the third position. The function is pretty simple and takes 3 parameters,…
After my laptop has been running really for a couple of weeks now, I have decided to order some new RAM and do a clean install of Lion. This has given me a great opportunity to configure my development environment in a cleaner and more organised way. As a developer I do install a number of packages to play around with and then either decide its not for me or find there was a better way configuring…
I've been playing with Ruby on Rails recently and I've been using Pow as a rack server for the applications I'm working on. So I don't have to keep running "rails server" when I want to test an app out. It's a brilliant little tool from 37 Signals that they describe as a zero-config rack server and it is just that. The only drawback to Pow is that it highjacks all localhost requests, this means…
I just came across a free eBook called Locking Down WordPress from CodePoet featuring Rachel Baker, Brad Williams, and John Ford. It's an interview style book asking the 3 pro's how they handle security for their sites and is a must for anyone who uses WordPress for their clients as it will save headaches later on!
This week I learnt an important lesson when using Search and replace in WordPress. When I'm working on a site in development I have WordPress running on a dev domain so the client can view the website and make any changes via the dashboard. When the site is ready to go live I go about transferring the domain. To do this I also need to update any posts in WordPress that may contain the old dev…
Ok so I've finally got my site live and its a great feeling. It has only taken me a year, if anyone says its been longer than this, well they are probably right! I'm not a designer, which has been one of the major road blocks for me as I've never been that happy with a design that I've put together. I took a lot of inspiration for this design from Chris Spooner's article on How To Build a Stylish…
I use MAMP as my local development environment. MAMP is brilliant as it installs the software (Apache, MySQL and PHP) used to run a web server similar to a LAMP server. This is great as it means you can test your files locally without having to upload them first. As I work between a MacBook and an iMac I was looking for a away to keep my projects in sync between the 2 machines. I turned to Dropbox…