I Love Burgers

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!!

Installing WordPress as a Submodule

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.

WordPress Security

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 | Add a style sheet to your theme quick and dirty

So you might need to add an additional css style sheet to your wordpress theme. If you are not developing a theme for the public and it is just you that is going to be working on the site and you just want to get it done quick and dirty then you can just navigate to your theme folder and open up your header.php file in your code editor and past in the link element that references your new css file.

Your final code will look something like this: –

<head>


<!-- all your header code -->


<link href="http://my_wordpress_site.com/wp-content/themes/my_wordpress_theme/my_style_sheet.css" media="all" type="text/css" />
</head>

Just add the link element just above the closing head tag and put your new css file in your theme directory. That would work but like I said it’s quick it’s dirty and I wouldn’t recommend it for anything other then a personal site.

I will be adding better and more complex ways to get this task done in future posts but if you really need to know now you can check out the enqueue style function in the wordpress codex