By default, performing a search on a WordPress website will search through everything; all pages, posts, and any custom posts types that have been created. I came across a scenario earlier however where I wanted to exclude pages from the search and filter the results by multiple custom pos...
When storing information in a session, it is likely that you may want to add additional inormation to this session at a later date. For this particular post I’ll be focusing on how to achieve this within CodeIgniter. Allow me therefore to first demonstrate how the session we will be ...
There are lots of plugins available for WordPress that allow you to quickly and easily embed forms within a website. Sometimes however, you may need to build a standard form that submits the same as a non-WordPress site. I needed to do exactly this today. I built the form’s HTML, mad...
Whilst recently implementing a NextGEN photo gallery plugin into a WordPress site, I came across a problem whereby pages that should have been displaying galleries or albums, were instead showing a 404 page. I was stuck on this problem for literally 2 hours and, after searching on forum af...
The ZipArchive Class provides a quick and easy way to create, or extract, Zip files using PHP. I did face a problem recently though when trying to build a zip file, and it took me a while to figure out the answer. I would open a new Zip reference, add some files, and then close [...]...
I’ve just experienced a problem when working on a WordPress website whereby I registered a custom post type in functions.php, however I could not get it to display in the left hand navigation. I received no errors at all, the post type would just not display. My code was as follows: ...
The WordPress platform contains a feature allowing direct editing of theme and plugin files through the backend when logged in. Before today I had never used this functionality due to always having had access to the actual files, for example, via FTP. Today was different however and I foun...
Whilst recently working on a site built in WordPress I had a site structure that would never go more than two levels deep. As a result I wanted to make it impossible for a user to set a page three levels deep, and managed to do this by limiting the pages they could select as [...]...
I just had to perform a check in PHP to detect whether duplicates existed in a given array. My first thought was to do some fancy looping and sorting of the array but I then came up with the following function and thought I’d share it: function arrayContainsDuplicate($array) { return...
I’ve been working on an e-commerce WordPress website that uses the WooCommerce plugin to power the shop and checkout process. The plugin has made the setup of the shop very simple and handles the majority of the tasks associated with an online store. One thing that I did struggle wit...