Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 207 of 219)

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

How To Setup Custom Queries For WP_Query Pagination

One of the nicest things about using WP_Query is that it allows you to completely customize the data that you’re bringing back to the front end.

For those of you who are completely unfamiliar with this API, it’s a powerful class that allows you to custom tailor a query against the WordPress database for retrieving information about posts, pages, custom post types, and so on.

If you’re using one of the more common features of WordPress, such as those mentioned above, then it’s relatively easy to get started; however, if you’re doing more complicated work, such as including multiple custom queries in a single view, then there are some challenges that you may discover.

Personally, I’ve been working on a project where I have two custom queries running in a template and I needed to paginate the results. The problem is that using the usual functions for doing this, that is:

Were not working as expected.

Ultimately, it required me passing a little bit more information to the query’s arguments array and to the pagination link functions. Here’s how you can setup WP_Query Pagination to work properly in custom queries.

Continue reading

Another WordPress Podcast?

One of my favorite things to do when going on a run or a long drive is to queue up a few podcasts and listen to them. Generally speaking, most of the podcasts that I listen to are directly related to things I’m interested in and/or interested in learning more about.

Then again, isn’t that what everyone listens to?

With that said, I can honestly say that I’m not familiar with a significant number of high quality WordPress podcasts. In fact, the one’s I’m most aware of are published by WPCandy, and Jeff at WPTavern (on which I had to pleasure speaking last year).

I have an idea for another type of WordPress podcast, but I’m wondering if there’s room for it, or if the reason there are so few is because there’s so little interest.

Continue reading

My Strategy For Organizing JavaScript in WordPress

Yesterday, I shared my strategy for using LESS in WordPress and enjoyed the comments that followed. In that post, I also mentioned that I have a similar strategy that I use to maintain my JavaScript files.

This particular aspect of development is one that I’m still experimenting with; however, there are certain aspects of it that have remained constant.

To follow up with yesterday’s post, I thought I’d share several things that I’ve consistently done that have improved development as well as some of the things that I’m currently doing that are proving to be useful.

With that said, here’s my current strategy for organizing JavaScript in WordPress.

Continue reading

Writing PHP The Right Way

PHP The Right Way

Last week, I wrote two articles discussing code quality when working on WordPress-specific projects:

Both of the articles lead to good comments, links, and thoughts from you guys. Though many of us are familiar with the WordPress Coding Standards, they don’t cover everything.

Rachel Baker shared a link to PHP The Right Way – a solid resource for writing PHP-based code when the coding standards leave something to be desired.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑