Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 377 of 427)

What’s The Best Way To Manage WordPress Assets?

When it comes to developing web sites and web applications, there are two things that developers always consider as it relates to the project’s assets and its performance:

  • The number of HTTP requests a page requires
  • Loading all of the assets versus only what we need for a page (also known as YAGNI or You ain’t gonna need it.)

This is an obvious problem as we have tools like Head.js and Sprockets for managing this issue, and then we have customizers for larger utilities like Bootstrap that allow us to customize our builds.

Managing WordPress assets is becoming incredibly more relevant especially as frameworks, themes, and plugins become more powerful, and as people begin to build full applications on top of WordPress.

Continue reading

Extending WordPress Plugins with Hooks

I've closed comments on this post as I'd like to keep the discussion on the source post.

Earlier this week, I shared my thoughts on custom, non-standard hooks within the context of WordPress themes which resulted in a great discussion in the comments and on Twitter, so it seems only appropriate to share a resource on how to get started with WordPress plugin hooks.

WordPress Plugin Hooks

Last week, Pippin Williamson of Pippin’s Plugins published a terrific article on Envato that explains how to write extensible plugins with WordPress plugin hooks.

Continue reading

How To Get a Page’s Permalink By Slug

If you’re used to working with The Loop, then you’re all too familiar with the_permalink. Simply put, it’s how to get the link to the post currently being rendered in the browser.

But if you’re working on anything more advanced than using the typical Loop, then you may be looking to get the permalink for a post by other means – perhaps by a page slug or by a page’s title.

I’ve had to do this in some recent work, as well, so here’s what I do when I need to get permalink by slug:

Continue reading

Why I’m Against Placing Custom Hooks in WordPress Themes

One of the things that I my team and I are often asked is if we’re ever going to place hooks in our core theme files for Standard. The short answer is “no,” but there’s actually a few reasons why I’m personally against placing custom hooks in WordPress themes.

Although this is stemming largely from building and managing a commercial theme, the discussion isn’t limited to that particular scenario. Rather, this is something that I’ve actually discussed with a number of other WordPress users and developers.

Overall, I’m generally against placing custom hooks in WordPress theme files, so I thought I’d share my reasons why I’m not a fan of doing this.

Continue reading

How I Organize My Files When Developing WordPress Themes

I recently shared how I organize my files when developing WordPress plugins, but since I also work with themes and have recently been building two applications using WordPress, I thought I’d also share my thoughts on organizing WordPress theme files.

For what it’s worth, I think that some developers – especially beginners – often try to make the plugin model fit the theme model or vice versa, and although both types of projects are aimed specifically at WordPress, they require different approaches.

Simply put, theme file organization differs from plugin file organization. With that said, here’s how I organize my files when developing WordPress themes.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑