Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 19 of 50)

Notes on programming-related problems that I’ve encountered while working on various projects.

Quick Tip: Multiple InfoWindows with Google Maps

Recently, I’ve been working with the Google Maps API in order to plot locations that are stored as custom post type meta data in the WordPress database.

Google Maps InfoWindow

 

The general functionality is as follows:

  • For each of the locations stored in the database
  • Generate a pin for the location
  • In addition to creating a pin, create an information window that shows the pin’s location

The information windows that sit above the flags are also called infowindow within the context of the API.

The Google Maps API documentation is pretty good in covering stuff like this, but I did run into a couple of gotchas when working with it, so I thought I’d document them here just in case anyone runs into the same problem.

Continue reading

Searching with Substrings in WordPress

Let’s say you’re in the process of building some type of search mechanism using WP_Query and you want your users to be able to run the search using part of a string.

That is, let’s say that you’re searching Companies (which is a custom post type) and some of the company’s names is “Awesome Code.” The user doesn’t know this because you’ve built a huge database and have been wildly successful with your app.

So let’s say the user opts to try to run a search using the fragment of ‘awe’ or ‘some’ or ‘code’ or some fragment variation thereof – how are we supposed to be able to pull back results like that?

Continue reading

How To Check if a WordPress Term Has a Child

If you’re in the process of working with hierarchical terms, then there’s a chance that you’re eventually going to need to know if a given term is the parent to another term.

For example, let’s say that in one of your templates, you’re responsible for displaying a list of all of the terms that do not have children for one reason or another (or maybe you’re responsible for display only terms with one children or another).

Whatever the case, this is a relatively straightforward operation to do assuming that you have the term’s taxonomy readily available.

Continue reading

My Productivity and Entertainment in 2015

Every year we end up trying out new services, solutions, communities, chat rooms, groups, apps, and other forms of technology that, by the year’s end, may be contributing more noise than signal to our day-to-day.

Perhaps I’m about idealistic, but I think that the majority of us are concerned with making sure that we have the tools that we need to get our work done and nothing more, nothing less (with the occasional game or book for entertainment and/or educational purposes, of course :).

But you get the idea of what I mean: We start off with the best of intentions in getting only what we need in order to get our work done and end up with a plethora of extraneous things that we don’t necessarily need distributed across our various devices.

Then again, maybe I’m the only one who’s suffered from this. But not likely. Here’s a run down of the things that I’m looking to employ day-to-day for both productivity and entertainment.

Continue reading

What Are You Doing Inside of WordPress?

I know – the title of this post is kinda weird, but I figured it made sense given yesterday’s topic (that is, what are you guys and girls focusing on outside of WordPress in the coming year?).

After all, just because we’re looking to focus on things outside of WordPress, that doesn’t mean that we’re going to be moving on or moving away from WordPress.

And since WordPress is comprised of so much – that is, core developers, plugin developers, theme developers, documenters, teachers, educators, event organizers, and so on – I’m interested in seeing what you’re planning to do in the coming year, as well.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑