Monthly Archives: April 2012

Frankie Jarrett - The Solution

I’ve been HEROized as The Solution!

Last night was a very memorable night for me as my friends at X-Team unveiled my inner superhero, dubbing me as The Solution!

The Solution

When Frankie Jarrett isn’t living his passion for working in WordPress or making music, he’s the problem solving hero known as, The Solution!

He was born with the amazing cerebral super power to solve any problem. Frankie can always figure out a way to communicate clearly with anyone. He is often there to listen and offer support to others, no matter how difficult their situation. Often Frankie only needs to say, “I’ll have to think about this problem a little”, and soon he has an exciting solution!

No situation is too big or too small and there is no danger too great for him to face. Whether you are having a tough time remembering trigonometry for your math test, or you are stranded on the roof of a burning building, The Solution can always figure out the best way to rescue someone.

Our hero also has the natural ability to inspire others, whether leading musical worship in his church or jamming with friends, Frankie uses his voice and musical talents to uplift and inspire those around him.

When not saving the innocent, Frankie spends his time watching the History channel with his wife, whom he absolutely adores.

Being HEROized is a true honor, and I am grateful to Dave and the rest of the team for recognizing me in this way.

Now to create more solutions! :)

Add first and last classes to your loop without using JavaScript

So you’re a pixel-perfect designer who wants to keep control over your WordPress loop styles? Hell yeah! You’re already pretty cool in my book.

You’ve probably got a fancy post separator, or a brilliant doodle to fit between your last post and the comments. Whatever the reason, you don’t have CSS class selectors for targeting the first or last posts in your archive – and you really need them.

There are a lot of tutorials on how to achieve this with jQuery. But it’s not worth relying on JavaScript for something that can easily be done with a little PHP magic.

First, insert this function into your functions.php file.

Now, open up loop.php and replace post_class() with the newly created fjarrett_post_class().

This new function accepts the same parameters as the original function, so you can use it the exact same way. The only difference will be that the first and last posts will be marked automatically with an appropriate class name. Enjoy total control. :)

If this helped you in any way I’d love to hear about it in the comments!

The simplest way to require/include wp-load.php

If you want to use WordPress functionality in a PHP file that exists outside of your WordPress installation then you need to include wp-load.php. Perhaps you could call this “hooking into WordPress”.

Maybe you’re already using some sort of relative path method, like:

But this can create problems if directories change. You need a clean, dynamic way to get wp-load.php. So here is the simplest way to do it, with just two lines of code (place it at the very top of your file):


Short and sweet :)

Disclaimer: This is intended for experimental and development purposes only. It is not advised to redundantly load WordPress on live production environments. But, why?