A Love Letter to FrontEndNorth

Dear FrontEndNorth,

Before you, things were not so good. I wasn’t happy, I really wasn’t myself and I was longing for change.

Although I was in a stable relationship and was doing all that was expected of me, I was frustrated, without hope or any kind of excitement or challenge, clouded by doubts about myself and wondering whether D-Ream was telling the truth about things only getting better.

Then I heard about you, and I decided to see what you could do for me, whether you offered anything I’d been missing out on. Sure, our liaison on that brisk November day was a brief one in the grand scheme of things, but it had a lasting impact on my life that I’m still thankful for today.

I’d been sceptical for a while, unsure as to whether you and your sort were worth giving my time and attention to. Were you really that good, that interesting and you know, fun? I just decided to open my mind and give you a go. What was the worst that could happen?

Well, you certainly didn’t disappoint.

You opened my eyes and made me realise that I could take a new path, one that would be full of fun and new experiences, complete with plenty of exciting opportunities and interesting people along the way, not to mention hard work! A path that would challenge and reward me in equal measure. I’d just need to be hungry for it and commit myself fully, holding nothing back.

I was keen to make an impression during that day we spent together, as I’d realised quite early on that it was a perfect time to roll the dice and see what happens, to see if the old proverb “fortune favours the brave” was true.

So I did my best to impress and be noticed, and it paid off. I ended up going for a few drinks in the evening, and took a chance. And as a result of taking that chance, I’m in a new relationship now, one that has completely changed my life for the better.

I’ve grown as a person these last 18 months or so, more than I thought I could in such a short space of of time. I travel more than I have in a long time, and have met so many interesting people along the way. I’m encouraged to do and try new things, and I spend so much more time at home than I thought I’d be able to.

Most importantly, my voice is heard and my opinion counts. I feel like I make a difference and that I’m not just there to serve a purpose until the next one like me comes along, unlike in my previous relationship.

All because of that one day with you.

Granted, it’s been a lot of hard work, but what relationship isn’t? We Make and Do so much, enjoying the good times and tackling the bad times together. We have each other’s backs and want to better ourselves, and that’s what matters.

After you led me to such a fantastic opportunity back in 2014, I’m so excited to be seeing you again later this year, but this time I’m in a position to help you make a difference to other people’s lives, the same way you made a difference to mine. Sure, you can be stressful at times and it’s been a while since anyone has seen you, but a little mystery goes a long way doesn’t it?

I just hope those people with whom our paths will cross with on September 30th,  when we see each other again in Sheffield, who are in a similar position to the one I was in when I met you nearly two years ago, decide to make the most of the day and fall for someone or something new, because it is absolutely worth it. If you want it enough.



P.S If you’d like £20.00 off a standard delegate rate ticket to FrontEndNorth use the code DAVEFEN when buying through EventBrite.

P.P.S Has anyone got a contact at Mills & Boon? 😛

Enqueuing JS for legacy browsers, the WordPress way

One of the things I love about being a WordPress developer is the ongoing discovery of core functions that make my life easier, or empower me to implement more best practice in my code.

At Make Do one of my chief internal responsibilities as front-end lead is managing our workflow boilerplate Kapow! which we use as a basis for all new WordPress projects.

In the theme component of Kapow! I’ve been happily adding a script to header.php the old fashioned way, which contains various poly-fills and shims to provide enhanced out-of-the-box support for legacy IE versions 7 & 8.

<!--[if lt IE 9]>  ?php%20echo%20esc_url(%20get_stylesheet_directory_uri()%20);%20?/assets/js/header_ie.min.js <![endif]-->

Normally I would rely on WordPress core’s wp_register_script() and/or wp_enqueue_script() functions when introducing JS or CSS assets into a theme to follow best practice, however in this case the need for conditional comments has meant that I’ve had to stick with the old fashioned way. Until this week…

Enter wp_script_add_data() ! This function exists for adding metadata to a script. It accepts three arguments: handle, key and value. You can find the function documentation on the Code Reference. Another gem that I had absolutely no idea about!

The handle is the unique ID you assign to the script when registering and/or enqueuing e.g. legacy_ie.

The key relates to the type of metadata you’re adding and from what I can see conditional is the only documented value available for use. This tells WordPress that the script in question should be enclosed within a conditional comment.

Finally, the value is the content (in this case at least) of the conditional itself e.g. lt IE 9 to detect all versions of IE lower than 9.

This meant I could remove the script from header.php and add the script The WordPress Way as shown in the Gist below.


As you can see we enqueue the script (no need to register unless it’s a dependency that needs to be referenced elsewhere) and then add our script meta to introduce the conditional comments before hooking into wp_enqueue_scripts to invoke the function.

The script will then be added to the header rather than the footer as the wp_enqueue_script() parameter $in_footer defaults to false if not supplied.

And there you have it, a way to introduce scripts wrapped in conditional comments into your theme without polluting your template files.

You truly do learn something new every day!