Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 289 of 428

How To Check if a Page Is in an iFrame

iframes aren’t exactly the most widely used browser technology anymore, but that doesn’t meant that they don’t have their place, especially in WordPress development.

For those of you who have worked with features such as the Theme Customizer, then you are certainly familiar with how the feature is structured and the role that an iframe plays in giving you the controls and preview of the theme as you’re making changes.

Although it may not be terribly common, there are times in which you may need to check if a page is in an iframe.

There are a variety of reasons in which this may need to be done (dynamically adjusting the height or width of an element on resize, for example), and it’s really easy to do with a little bit of JavaScript.

Continue reading

Writing Open Source Code (Or “Here Be Dragons”)

Here Be Dragons

I don’t know if this is something that every developer experiences – regardless of what level of the stack you work on – but I know that for those who truly care about getting better at what we do, there’s often this constant feeling of “I think this could be better.”

Or, perhaps another way of saying it, is that one of the challenges in writing open source code is the criticism that can come that infuse a level of self-doubt.

For example, how many times have those of you who have contributed to a larger project, built something of your own from the ground up, or simply tried to write a small add-on to an existing solution, ended up with something that works, but have this sinking feeling that this just isn’t as elegant – or, I dunno, optimal – as it should be.

I mean, surely it’s not just me, right?

Continue reading

My Preferred Web Page Screenshot Tool, Take 2: Awesome Screenshot

I no longer use this extension. You can read a technical explanation as to why on this page.

As you guys know, I like to keep a list of tools that I use on a day-to-day base to help get work done. And early last year, I shared that I was a fan of Screen Capture by Google.

Unfortunately, as Chrome has updated, the plugin has not and I began to experience more and more issues with it crashing, not saving screenshots, and generally not working. When this happens, I do what everyone else opts to do: look for a new solution.

For the past several weeks, I’ve been using Awesome Screenshot and I’m a big fan of it.

Continue reading

Filtering wp_title and Why This Matters

For anyone who has experience in building WordPress themes – or even just one theme – or anyone who has experience in working with child themes, or simply modifying a core theme, then you’re more than likely with <a title="wp_title" href="http://codex.wordpress.org/Function_Reference/wp_title" target="_blank">wp_title</a>.

It’s one of the tags in WordPress that’s easy to usd and that’s easy to understand. Straight from the Codex:

Displays or returns the title of the page. A separator string can be defined, and …, that separator can be designated to print before or after the title of the page.

This tag can be used anywhere within a template as long as it’s outside The Loop on the main page, though is typically used in the <title> element for the head of a page.

Not much to it, right?

But it’s also one of the tags that can be abused which can cause problems especially as it relates to plugins.

Continue reading

Test Your Own Work: Officially On Mayer

One of my dogs with the Monday feels.

dog fooding can sometimes give you the monday feels (as one of my dog demonstrates)

As I’ve mentioned in previous posts, I firmly believe that developers should be dog fooding their own work.

This isn’t to say that I don’t believe that assembling a team of beta testers is unimportant – on the contrary – but if you’re building something, and the only people who have experience using said product are people other than you, then I think that’s a problem.

So as of today, I’m proud (if not a little bit embarrassed) to be officially test-driving Mayer – my next WordPress theme that I’ve been discussing for sometime.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑