WordPress: insert a user into the database

WordPress stores all user data in two tables, namely wp_users and wp_user_meta. If you've ever tried to insert a new user in the database, you've surely stumbled on some WordPress error while trying to display user preferences or profiles. The point is that both tables work together, so that if you fail to specify some data in one of these tables, you'll get an error. Fortunately, there's a solution.

WordPress: display images from custom fields

A couple of weeks ago I finished a WordPress project which consists of a jQuery slot machine product slideshow. The problem with this plugin was to allow the administrator to insert all the required images and captions in order to make the slideshow work. For that reason, I used WordPress custom fields. The tricky part is to fetch the images attached via custom fields. Let's see how.

Integrating jQuery plugins in WordPress

One of the most frequently asked questions on forums, blogs and mailing lists concerns the integration of jQuery plugins with WordPress. Integrating jQuery plugins with WordPress is not a matter of queuing scripts only, but it also means understanding the correct hierarchy and order by which scripts are executed within WordPress. Let's see the details of this topic.

WordPress is for blogging: any other use is a costly mistake

I don't understand why most web agencies tend to use WordPress as a catch-all for every project they work on. In short, WordPress is a CMS designed to manage blogs or blog-like web sites. WordPress was not designed to manage e-commerce sites, communities or even newsletter or file downloads. The more the task diverges from the original design, the more it's likely that your project will fail or, if you're lucky and patient, need continuous assistance for bug fixing, maintenance and plugin customization. You'll probably end up with a disappointed and angry client and a significant increase of your budget costs. You don't deserve this.

WordPress: how the eShop plugin works

The most interesting working experience had so far with WordPress is surely the radical changes I had to make to the eShop plugin. A client wanted that instead of processing orders the plugin should send an e-mail with a pre-order receipt. Further, the shopping cart must be modified so that it can accept a discounted value for each item. Said that, let's see how eShop works.

WordPress: publish a tweet as a post

Twitter is surely one the most popular social networks on the web, and WordPress is surely one the most popular CMS available today. Usually these two platforms interact only in one way: you get something from Twitter, you post something on Twitter. Let's say that you want to publish your latest tweet as a post on your WordPress site, also checking if there is another brand new tweet available. How we can to this?

WordPress: adding social buttons with iframes

JavaScript social buttons are evil. They may cause major hiccups in the overall performance of your sites, not to mention that they may actually block the rendering of your pages. Iframes are better, because they load simple HTML snippets. In this post I'll show you how to add the Twitter, Facebook and Google Plus buttons to your WordPress theme.

Object-oriented programming with Wordpress: utopia?

A long debate among Wordpress developers is essentially about the possibility of using truly object-oriented code in their themes and plugins by exploiting the latest features of PHP 5. Most developers who don't are accustomed to OOP in PHP think that OOP in Wordpress is rather difficult to accomplish and, in a certain sense, even counterproductive. But if you take a closer look at the inner structure of the Wordpress core, you'll surely notice the abundance of classes and most of the OOP features we're all used to see in other frameworks. This post is written in the hope of stimulating a renewed interest in OOP with Wordpress.

CSS: best and bad practices in Wordpress theme development

One of my daily tasks as a developer is to modify the default styles which come along with a new Wordpress theme chosen by our clients. I have to say that this task is made harder and harder by some obtuse practices followed by many theme developers when it comes to CSS. I don't want to be rude because I love your work, but you should consider the fact that your styles may be changed by another developer or user, so you should code your CSS accordingly. Here are some of these bad practices that make me feel frustrated.