Software Engineering in Web Development, Backend Services, and More

Tag: WordPress (Page 172 of 220)

Articles, tips, and resources for WordPress-based development.

Strategies To Future Proof WordPress

Future Proof WordPress

You’ve gotta be prepared for the future, just in case you end up there.

For those of you who have read this blog long enough, you know that I’m a big advocate for using WordPress for web application development.

No, I don’t think it’s the end all, be all of foundations for web applications, but it’s one that shouldn’t be overlooked depending on the nature of your requirements.

Anyway, a friend of mine recently contacted me asking what I do to future proof WordPress when I begin to use it build applications on top of it. Specifically, he asked what steps I take when working on projects that may end up breaking with the next WordPress upgrade.

Since I don’t recall ever sharing the steps and tools that I use, thought it would be good to cover here.

Note that these aren’t all the things that I do or that can be done (and I’m sure you guys have some great suggestions, too), but these are the things that came to mind that I’ve found to be absolutely critical.

Continue reading

A Simple Helper to Check if a Post Has Comments or Pingbacks

A previous post, I shared a strategy on how to separate comments, trackbacks, and pings in a WordPress post.

In short, the article covered how to create a template such that the comments would be listed first, then the trackbacks and pings would be listed second.

In addition to creating templates that separate the types of comments related to a post, I also find it useful to have a helper function to determine if a given post has comments and/or pingbacks.

Continue reading

Programmatically Upload Files in WordPress (and Create Associated Meta Data)

This is post one of two on how to upload files in WordPress and created associated meta data.

In a recent project, I’ve been working on a plugin in which the user needs to upload a file to a custom post type by using an input element (of type file, obviously) rather than using the WordPress media uploader.

In addition to being able to upload the file, the user must also be able to view the file and remove the file (via Ajax) by an available anchor.

In order to do this, the plugin has to do the following:

  1. Upload the file to the `uploads` directory
  2. Save the file URL to the custom post type’s post meta data
  3. Save the file path to the custom post type’s post meta data
  4. Delete the file from the `uploads directory
  5. Clear the post meta data referencing the file

The primary reason that you have to store the file’s location on disk is because you can’t rely on PHP to delete a file via remote requests.

To that end, you need to be able to store not only where the file is on disk (for the sake of being able to delete), but also the URL of the file so that visitors or viewers can access the file via their browser.

Over the next two articles, I’ll share how to programmatically upload files in WordPress and save their associated meta data, and then I’ll share how to programmatically delete the files in WordPress as well as their associated meta data.
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

Developers Need Help Marketing WordPress Themes

If you hang around the WordPress Community long enough (that is, those people who are involved in working on WordPress or building something on WordPress in some way), you’ll notice that we all have a tendency to aim to build the best thing possible – whatever that may be.

At least, that’s what we claim to be doing.

And I’m just as guilty of this as the next person.

But let’s face it: developers need help marketing WordPress themes. Perhaps designers do, too. And let’s not forget plugins or other add-ons.

Basically, I think that we get so involved with the community of which we’re a part, we forget about the market and the terms in which they think. We’re busy trying to help one another other, perhaps even impress one another, and even working to try to out-do each other (I mean, come on, that is competition, right?), that we end up marketing our products in the same way every single time.

And you know what I’m talking about.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑