Categories
Programming

WordPress Loop Error Using get_the_terms

If you get this WordPress Loop Error… “Warning: Invalid argument supplied for foreach() in [filepath].php on line [number]” when you try to loop over terms found using the WordPress function get_the_terms, you may find this information useful. It happens when you have a post that hasn’t been linked to any terms… but it caused by […]

Categories
CMS Programming

WordPress Custom Query Page Size

WordPress normally takes care of queries for you. When it doesn’t, your next port of call is normally WP_Query. After that, you head into nuts-and-bolts mode with a completely custom query using get_posts. When you start taking control over queries, you may hit this common problem with page size. Here is an example of custom […]

Categories
CMS Programming

WordPress Social Sharing Links Without JavaScript

If you, like me, find yourself staring at the network traffic spewing out of your website you will have noticed the JavaScript problem. No matter what plugin you use, it seems to require three or four JavaScript files. Want to show a picture of a cat on your website? You’ll need jQuery, React, and Meteor. […]