That’s right, I love burgers and I’m not talking about McDonald’s or Burger King. I Love the ubiquitous little 3 line icon a the top right or top left of loads of mobile and desktop apps. The thing is, a lot of people hate burgers, even more than Morgan Spurlock. I’ve read many post that say burgers are bad for engagement and conversion and even that the burger must die. So why is it still so use by still so unpopular?
It is not a burger!
Sorry to burst your bubble but those 3 little lines don’t represent a burger or a hot dog or any food substance, they are an item list or you might say, a menu! It’s pretty obvious when to you think about it just for a second. In fact I don’t think I ever saw them as a burger and the sooner we stop referring to them as a burger and maybe make them look just a little more like a list or a menu, then the soon we can all start using them without the fear of our user abandoning our web sites because they can’t navigate is and and have suddenly become strangely hungry.
How I saved the burger with sass
No biggie but I just made a single element menu icon with everyone favourite preprocessor sass. That’s right just include the sass mixin and then add to any anchor element with a simple @include menu-icon() . Guess what it doesn’t even look like a burger.
Don’t go any where i’ve just had an idea to create a single element Big Mac!!
When start any web project one of the first things I do is to set up a repository with git and get my code under version control. Version control has quickly become an invaluable part of my work flow and I suspect it has save me hour of time and headache. If you are not version controlling your projects then I full recommend you check out git and github and dive in.
When it comes to WordPress there is some discussion of what to put into your repo. I generally just version control the theme folder that I am developing which has worked pretty well for me. The other alternative is to version control the whole wordpress install and by that I mean the core file the plugins and the themes.
Of course there are pros and cons to both methods, which can basically be summarised like this:
The theme only method means that your repo will be leaner and easier to understand there will be no commits if WordPress updates or if you install a plugin only the changes you make to your code in your theme folder. It also means that you can easily reuse your theme on any site you wish
The downside is that when you deploy your theme then you will manual have to add any plugins that you need to your live site. Also you might need to update wordpress to the same version of your dev site.
Unsurprisingly committing the whole WordPress install has basically the exact opposite pros and cons.
There is a third method which is gaining popularity and that is to install wordpress as a git sub module. This basically means that at the root of your site you have wordpress in its own folder as a git sub module and next to that you have your wp-content folder along with you wp-config.php file and your index.php file. Now this is easier to set up then you might think. I have created a simple wordpress sub module gist that shows the bit of config that you need to do.
I’m currently trialling this method in my latest project and with regards to the code management benefits of this work flow it is still too early for me to draw and conclusions, but at first glance it definitely seem to be a more modern and modular approach, which can’t be a bad thing. As a by product of this method I have also noticed a some security benefits for wordpress.
By installing wordpress as a sub module you can no longer access the WordPress login at the usual url i.e. mysite.com/wp-login.php instead you have to login within a custom folder like this mysite.com/custom-folder/wp-login.php. It stands to reason that if you do not allow signup on your site then this url will never be exposed to robots and the likes that might want to try and guess your password.
This may just be a little security gain but as it is so easy to achieve I think I will be using it regularly form now on.
WordPress’ bloginfo() is use to display information about your site such a the name or the or the template directory.
You can use it like this:
<?php bloginfo(‘template_directory) ?>
What you can’t do is to assign it to a variable. Why? because bloginfo() prints its output to the browser and create an error. If you want to use is at a variable or evaluate it then simply use the “get_” prefix like this: