Yesterday I was pleased to speak at the WordPress Cheltenham group. My talk was all how to write extensible WordPress code. I actively speak and have spoken at a number of these local events and something I wanted to explore was filming to talks to put up on the web. Here is how I did it and the kit that I used.
I have worked with Keith for 18 months now, as a freelancer on a number of projects. We met at the WordPress London Meetup in September 2014 where I spoke about my development setup. At the time Keith was on the lookout for freelancers to help him with projects that he had at the time.
We worked really well together with complementary skills sets. Keith very much more front-end focused and me liking to work in the back-end of WordPress. The projects we worked on were a great success and it became obvious that we should go into business together at the back-end of 2015.
The last few weeks have been extremely busy getting the business setup and in the right place to trade correctly. However it is very exciting and I look forward to working with Keith for many years to come on lots of exciting WordPress projects!
A few days ago I recorded a podcast with Ben and Mark from Relative Paths. We chatted about WordPress plugin development, adding plugin to WordPress.org Plugins as well as plugin maintenance and support. I thoroughly enjoyed chatting to Ben and Mark about WordPress – have a listen below.
Recently I was tasked with creating a fairly straight forward 1 page website in WordPress. It was one of those sites with the different sections and the main navigation scrolls you down to the correct section. The trouble was that for such as a simple website the admin experience was very complicated. Therefore I set about trying to make the admin more like the front end – more simple. Here is how I got on.
I have blogged and spoken about admin customisations before and those people that know and have worked with me know that it is something I both enjoy working with and something I feel is a little underdone at times with many WordPress websites. We spend all our time focussing on the front-end (which is not a bad thing in itself) but little time thinking about the experience for the person or people that have to manage the website.
The site that was in question is shown below and was designed by the team at Pixel Junction.
First a little bit about the setup I used with the website. As everything was on 1-page it kind of makes sense to me to make everything editable from within a page in WordPress. Therefore I created a page titled home and then set this as the front page under Settings > Reading.
The first step was then to edit the post edit screen for this page to better reflect the front end of the site.
The page itself was separated in four sections:
Header with background image including the navigation
Contact us section
Therefore I went about creating these in the backend.
To do this I used the excellent Custom Meta Boxes library/framework/plugin by Human Made (although there are a lot of other alternatives out there!). This allows me to quickly add additional meta boxes on the post edit screen, in order to better reflect the front-end. I could then add fields into these meta boxes which I could pull through to the front end rather than having the traditional content box. Below is what this page’s edit screen looks like:
Inside each of the meta boxes I could then add the custom fields necessary for the front end. Below shows the header content section expended.
In this post I won’t go into how these fields are pulled through onto the front end, other than to say that all of the data in these meta boxes is stored as post meta for this page and therefore using the get_post_meta() function allows us to do this.
The next issue to tackle was the menus in the admin. I wanted to end up with the following menu items in the left in the WordPress admin to clean things up and little removing menus that would not be needed:
Dashboard – which was actually my custom dashboard using my WP Basis plugin
Forms – the site would use Gravity Forms for the contact form
Content – this would be a link straight to the page edit screen for our front page
Site Options – I was using the options framework plugin to provide a few additional details such as telephone number etc. although could actually have added them to the page itself on second thoughts!
To do this I needed to do some admin menu modifications. I won’t go into great detail here as I have written before on altering the WordPress admin menus. Using the techniques outlined in that article I was able to add a menu titled content that went straight to my front page edit screen, remove some menus and add some others such as Menus which just went straight to the WordPress menu management page usually found under appearance. I was then left with this:
The final thing to do was to make it so that when the user logged in, they were taken straight to the page edit screen for the front page as this is where most of the content for the site is. This can be done easily by utilising the login_redirect filter and setting the location of the redirect to the same link as the new content menu.
This all works very well but there is one more thing to do and that resolves around capabilities. Normally next to the “Edit Page” title on the page edit screen there is an “Add New” link. This would allow the user to add new pages. However we don’t want them adding new pages and causing confusion. Therefore we can utilise WordPress’s capabilities and remove the capability of adding new pages.
To do this in my example I used the filters included in my WP Basis plugin, however you can do this using the user_has_cap filter. The capability to remove is the edit_pages capability. This will ensure that the add new link is removed.
So there we have it a better front and back-end experience for not much extra work. I would love to hear your thoughts and comments about how you do something similar.
Just over a year ago now, I quit my full-time, well paid job as a secondary school teacher to become a full-time (well nearly!) WordPress developer. You can read more about the decision I took at the time here. So a year on from that decision how has it all gone?
The story continues pretty much in the few days and weeks after I had resigned. I was looking at another local school’s website, I can’t remember why now but I happened to click on the vacancies page and there was an advertisement for a teacher of Computing for 1 day per week – perfect I thought. I had wanted to go part-time in the first place to ease the transition between careers, but for one reason and another it was not going to happen. Therefore I applied for this job, teaching year 7 and 8 students a bit of ICT and computing such as Scratch and Python. I thoroughly enjoyed this teaching but more about that later.
My biggest worry about quitting my job was simple really. Would I get enough work in order to pay the bills. With a small family to provide for it was alway the biggest concern. I had been chatting to friends and family and colleagues in teaching, all of which encouraged me that I would be fine and I should just go for it – they were right.
I think that is the first lesson to be learned here really. Sometimes there is no right or wrong time to do something like this, you have to just go with your gut, bite the bullet and do what you think is right. I came the conclusion that if I was thinking about this so much, it must be the right decision. Also I must add, having the support of your wife/partner really helped and I thank her for that a lot. She was always very supportive and pushed me to give it a go.
Having already worked for a number of years freelancing part-time, looking back I perhaps should not have worried about this as much as I did.
I already had a base and now I could offer those clients and other agencies I did work for much more time and a wider range of offerings that I could before.
I did also do some marketing in the form of speaking at conferences, although that was not my sole reason for doing this. I first spoke at WordCamp Sheffield in April 2014 and have spoken at a number of WordCamps and local meet-ups thereafter. Speaking is good to let people know who you are and what you do, but perhaps more importantly it helps you learn. To talk to people about something means you need to know it well and therefore the research and preparation you do around a topic helps your career development too.
Getting clients has not turned out to be as problematic as I thought and I have had work on throughout the last year. There have been leaner times that others but overall I have had a steady stream. Lets hope that continues.
I think something that you learn more and more and remember for each client that you work with is that you want them to continue being your client (most of the time!) and therefore treat them as though you do.
Running a Business
This was nothing new to me really in terms of I was not changing from being a the sole-trader that I already was from being a part-time freelancer. However there are some things that I have learnt.
The running of your business takes much more time than I ever thought it would do. Writing and sending invoices, communicating with clients, attending meet-ups and WordCamps and other marketing related stuff all take time. This is time that you are not earning and therefore you need to consider this carefully.
Think carefully about how many actual billable hours you can work in a day, week, month and year and then you need to adjust how much you charge for actual work in order to accommodate this.
One of the things that I was insistent on when I went full-time was that I wanted to work from home rather than getting an office somewhere or perhaps a shared work-space. However as I have found out working from home does have its difficulties.
When you first start because you are at home for the first few days it is hard to remove all the distractions of being in the house and get on fully with your work. However I found this easy to overcome after a week or two and now when I am in my office working, focusing is no problem.
For other family members living in the house this has been less easy. My children for example are always popping to ask this and this and still to this day I have not managed to train them well enough to leave me be during work time. My wife, although considerably better than the children does have the tendency to say thinks like “Can you just put the drying in the dryer?” usually when I am knee deep into something complicated!
However all of that is getting better and I have plans this year to do some work on my work space at home to make it easier to work in etc.
So what next?
Who knows I guess… A year on and things have changed again for me. I am no longer teaching at all, as my position of teaching for 1-day was never a permanent thing. In fact I have enough work on to not continue with that which was always the plan anyway.
This past year has absolutely flown by and I look forward to the next year in freelance and the opportunities that it brings – it has been amazing 🙂
A month or two ago I had the pleasure of spending a day with other WordPress developers, designers and users at the WorcdCamp Manchester Contributor Day. As I have been working with WordPress for over 7 years now, and now earn my living from the software I think it is about time that I start giving back to the project. As part of this I intend, as often as I can to undergo a WordPress Sunday Support Hour.
It can be quite daunting thinking about contributing to the project. Most people think of contributing as offering up some code that will eventually appear in core and then be used by millions of people worldwide. As a developer this is something that I would love to do eventually, but I have to say, if I am honest that the process of contributing core code I found quite difficult. This is not because of a lack of support. Mike Little and Tom Wilmot where kind enough to help me get a local development environment setup on my Mac but I found it hard to just get started with contributing bug fixes and testing patches.
Therefore I went looking for other ways in which to contribute. The make.wordpress.org resource is a good place to start if you are looking to contribute. It lists all the areas and how to get started. The one that stood out to me, as an educator was the support section. Surely I could help people out in the support forums?
Well, I headed on over there last weekend and found myself assisting others with their queries and giving something back to those that needed help. It was very rewarding and I finally thought that I was achieving something on my road to WordPress contribution. I sent this tweets just before I started:
Spending an hour in the #Wordpress.org support forums for contributing purposes and because it helps others. Why not do the same?
I was amazed at how popular it was. 27 retweets, 9 favourites and 2 replies. Doesn’t sound much perhaps but that has got to be one of my most, it not most popular tweet.
Therefore I have decided that I am going to offer my skills in the wordpress.org support forums for 1 hour every Sunday (or as much as I can) in what I am hashtagging as #wpsundaysupporthour. So why not get involved and do the same?
WordPress provides a handy little widget where you can add your sites tags to a widgetised area and then are shown a tag cloud type format. However the output of this tag cloud cannot be controlled, like it can with the wp_tag_cloud() function. Having wanted to change the output I set about trying to achieve this. In this post I will outlined how to alter the output of the tag cloud widget in WordPress.
The key to altering such things as this is to follow the WordPress golden rule which is never to edit the core files. Therefore to overcome this problem we need to look at the core files themselves for code which will allow us to manipulate the output of the widget without actually altering the core code.
Looking in the wp-includes folder of WordPress core we see a file named default-widgets.php. It is in this file where the Tag Cloud widget code is sourced. Looking at the code we can see that WordPress applies a filter to the arguments it supplies to the wp_tag_cloud() function. This filter is named widget_tag_cloud_args.
Therefore we can use this to manipulate the output of the tag cloud before it is outputted to the browser. The example below allows us (for example) to set the max and min font size for tags outputted.
This is a good example of WordPress’ extensibility, something which I will be speaking about at WordCamp Manchester at the end of June.
Today I quit my job working as a Secondary School teacher in a Lancashire high school. The job was well paid, with a good pension and a good salary. I am leaving to work as a freelance WordPress developer and consultant with no guaranteed salary or benefits. Why am I doing this I wondered?
I have been teaching for over a decade now. I have taught a number of different subjects but finally settled into teaching ICT and in fact was Subject Leader (Head of Department in old money!) for over 4 years. It was during my teaching career that I developed a passion for working with the web and particularly WordPress, making blogs for students to access as well as websites for students to use in distance learning.
Why Leave the Teaching Profession?
For the majority of the last 10 years I have enjoyed teaching. It is such a varied job with different things happening every day that, on the whole it has been fun. However over the last 12 months I have seen a sharp rise in the work that I have been getting in terms of freelance WordPress jobs and I have had the privilege of working with a number of top WordPress agencies and people during this time. It has become more and more obvious to me that my future did not lie in teaching.
It was at this point I then spoke to the management of my school with the view of dropping down to part-time, perhaps 3 or 4 days work before winding down completely perhaps a year later. However I became apparent that circumstances at the school meant this was not an option and therefore I was left with a decision to make.
Working Two Jobs for Over 5 Years
I have been a freelance WordPress developer for over 5 years, starting out working on small business sites and now working on larger sites including eCommerce sites. Throughout this time I have been working two jobs, teaching full time which as been getting harder and harder. Having two young children means I can no longer do this and be successful at both. Therefore I had to make a decision as to which path to go down. The decision was quite easy really when I thought of it like this.
I have really got to the point whereby I cannot get any better and progress in either job as one was pulling back the other.