Software Engineering in Web Development, Backend Services, and More

Tag: WordPress (Page 51 of 220)

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

Adding WordPress Modal Dialogs (With Built in Libraries)

Whenever it comes to developing solutions for clients, there are going to be times when you’re likely tasked with displaying information in WordPress modal dialogs.

There are a lot of solutions available for doing this and the more familiar you are with JavaScript, various libraries, and the libraries that they have available, the harder (or maybe it’s even easier) it is to choose which one to use.

But WordPress has infrastructure built-in that makes it trivial to incorporate functionality into WordPress. So in three upcoming posts, I’ll cover the following:

  1. How to incorporate WordPress modal dialogs using built-in libraries,
  2. Populating the modal dialogs with data,
  3. Populating the modal dialog with dynamic data via Ajax.

Because of the nature of the series, the posts won’t be back-to-back, but they’ll all use a unique tag that you can use to bookmark and refer to as a series once the posts are complete.

With that said, let’s talk about easily incorporating WordPress modal dialogs with built-in libraries.

Continue reading

Adding Custom WordPress Image Attributes

When it comes to working with the_content, it’s straightforward.

  1. Set up a filter that’s hooked into the_content,
  2. define a function that accepts the incoming post content,
  3. make your changes,
  4. return the modified content.

And most of the time, this is all that’s needed. But there are times in which you may want to do more advanced things.

For example, perhaps you’ll want to include content from an external template. Or maybe you’ll want to add attributes to images that you find in the post.

Continue reading

WordPress Debug Logs Are More Important Than You Think

When it comes to working with WordPress, the Codex does a good job of showing how to configure the application for debugging.

In short, you add the following to your wp-config.php:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

There’s more you can add, but this is the general idea as to what I find useful.

But why bother covering this?

Continue reading

Updating Subsequent Events in Event Calendar Posts

This is a really nuanced case but I thought it might be worth trying to generalize for a post for anyone who may be working with future events with Modern Tribe’s Events Calendar.

Say you’re setting up some recurring event and within the body of the event (or, more appropriately, the post_content) you want to say something like:

It’s been N-years since [this event] occurred.

The thing is, each subsequent event will obviously be one year greater than the one before it. So you can’t necessarily hardcode the value into the events without it being placed into the post content of every event.

So what’s one way to tackle this?
Continue reading

Download User Email Addresses via JSON in WordPress, Part 2

In the previous post, I began sharing how to download user email addresses via JSON in WordPress (using Ajax). The first article covered:

  1. registering the JavaScript for doing so
  2. getting the users’ email addresses,
  3. and parsing out the results.

There’s more to do, though. Namely:

  1. converting the returned information into JSON,
  2. writing that file to disk,
  3. and how to tie the rest of it together using JavaScript.

And that’s what the remainder of this post is going to cover. So if you haven’t read the preceding article, I recommend it if for no other reason than to glance at the code to see it thus far.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑