I put together a .gitignore file that will exclude all WordPress core files from your repo so that only your themes and plugins will be uploaded – this works recursively, so that it will ignore all the copies of WordPress you have in the sub-folders of the repo.
I’ve been working on a lot of plugins lately – many for my work at WooThemes and a few for my personal projects – and over time I have developed a standard code base from which I start any of my new plugins. I decided to share that code base here.
It’s a common problem with a dozen different solutions – if you’ve ever needed to add a ‘select all’ checkbox to a form in order to make your users’ lives easier then you’ll have searched for a simple way to do it. If you’re using jQuery here’s a very simple method.
Most WordPress themes come with a few useful widget areas where you can place any widgets you like. Sometimes, however, you need to add your own widget area because the theme you’re using doesn’t quite cut it. Paste this snippet in your theme’s functions.php file to create a new widget area.
When building a plugin that has its own settings page, it’s often handy to create a link to the settings page straight from the Plugins list – this saves users the time it takes to find where exactly your plugin appears in the admin menu. Here is a simple code snippet that creates the settings link for you – all you need to do is tell it where to go.
If something goes wrong with your WordPress install due to a faulty plugin or some bad PHP code, it can often be tricky to work out exactly what the issue is an how to fix it. Here are a couple of helpful functions and snippets that you can use to fix a number of WordPress issues.
Vertical centering has always been a fairly elusive goal when dong CSS layouts, but it’s actually easier to achieve than you might think. Here are the two simplest methods that I know of to achieve this goal.
A quick line of code to ensure that your WordPress content editor will always land on the HTML tab by default. This will ensure that your HTML tags & attributes are never stripped automatically.
I, like many other people, recently created my own URL shortener that I use for links to pages on my website as well as sharing any other links I find. It was actually surprisingly easy to get setup thanks to a handy service called YOURLS, so I thought I would share the process here.
Near the end of 2010 a great little tool was launched called ifttt – the genius abbreviation of ‘if this then that’. It’s purpose is to connect together all the different online services it can or, as they put it, ‘put the internet to work for you’. I managed to get a beta invite to use the service shortly after it launched and since then I have been using it to make my life that much easier.
WordPress shortcodes are a handy way to add standardised or dynamic content to any post or page. Once you have used them for a bit you will start to realise just how powerful they really are. Here is a guide on how to create shortcodes that you (or your clients) can use.