Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 30 of 49)

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

Happy Thanksgiving!

Today is an official holiday in the United States, so I’m taking the day off of the usual routine.

For those of you who are in the United States and are celebrating Thanksgiving, I hope you guys have an awesome day hanging out with your family, friends, eating, sleeping, and generally enjoying the day off.

Happy Thanksgiving 2013!

Happy Thanksgiving, guys!

Continue reading

Add a Post Class in WordPress: The More Tag

WordPress’ `post_class` function makes it really easy to write out a variety of class names to post containers that give us a finer-level of control when working on styling WordPress posts.

But there are times in which you may want to actually add a custom class to a post (or to a single post) depending on the nature of the content of the most.

And sure, you can easily add additional parameters to the `post_class` function, but those are still static parameters that will be applied to every posts.

What about in cases where you want to add a class if, say, no more tag is present in the content?

Continue reading

How To Setup a Custom Grunt Task For WordPress

Now that WordPress 3.8 is in development, now is a good time to look into contributing a patch.

But seriously, if you’re looking into contributing to the codebase, then it’s important to be familiar with two things:

Once you’ve gotten those two things setup, you can actually setup customized Grunt tasks (via your own options) that will help test the work that you’re doing without kicking off the entire process, a part of the process, or testing individual files.

Continue reading

Setting Up Grunt For WordPress

With the WordPress 3.8 development cycle underway, I thought it might be worth sharing how you can go about setting up Grunt for WordPress development on your local machine.

The reason for this is because WordPress is now using Grunt, JSHint, and a number of other utilities to help automate tasks, and if you’re looking to contribute to certain parts (not all, mind you) core, then these are the tools that you’re going to need – especially if you’re working on any tickets under the Build Tools component.

Continue reading

WordPress: Fatal Error Memory Exhausted

At some point, anyone building a theme, plugin, or even just working with WordPress has seen the Fatal Error: Memory Exhausted message. It typically reads something like this:

Fatal error: Allowed memory size is 268435456 bytes exhausted (tried to allocated 29596635 bytes) in …/wp-includes/wp-db.php on line 885.

Yes, your message may be a little different, but the point is the same: You see a fatal error, it has something to do with the amount of memory allowed, how much was attempted to be allocated, and what file threw the error.

In my opinion, one of the big problems with errors like this is that it’s far too easy to Google for a quick solution to fix the problem rather than truly understand the problem.

Sure, I understand we’ve got stuff to do and work to get done, but understanding what the problem may be is important to helping us become better developers, and, who knows, we may uncover a bug in a piece of open source software.

In this case, it’s not the latter, but here’s a good way to go about understanding the above error.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑