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.
Showing posts with label wordpress. Show all posts
WordPress: advanced user profile customization
WordPress allows us to add any kind of content to any section of its backend. In this post I'll show you how to add custom fields and data to the profile page of WordPress users.
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: Timthumb vulnerability fix
If you're viewing the above screenshot on your site with Chrome, your site has been compromised by the Timthumb vulnerability. The best thing you can do is to follow the instructions provided below.
WordPress: the_post() in depth
the_post(), as a matter of fact, is the most used WordPress function in any theme but also almost unknown to the masses. We all know that this function initializes The Loop, but we actually don't know what kind of internal routines it uses. Let's see them together.
WordPress: compact posts
WordPress posts are usually displayed as full posts. Now let's say that we want to display them in a compact way, e.g. the first post in full followed by an unordered list of posts which also feature a post thumbnail. Let's see the details.
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: use a post title as a thumbnail overlay
We can easily create the effect of post titles used as overlays over post thumbnails by combining a little WordPress coding and some CSS techniques. Let's see the details.
jQuery: AJAX contact form for WordPress
jQuery can actually interact very well with WordPress. A typical example of this is surely a contact form enhanced with AJAX. Let's see how things work from the client-side point of view.
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?
jQuery: the moreLink plugin for WordPress
moreLink is a jQuery plugin written by me that handles the 'More' links of a WordPress site by fetching the linked post via AJAX without refreshing the page.
WordPress: creating a custom CSS
The recommended way of customizing your default WordPress theme is to create a child theme. However, sometimes we only need to add just a few style rules to override some default styles of our theme, so what we really need is to create a custom style sheet for our theme. Let's see how.
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.
WordPress: handling post thumbnails
Some WordPress themes don't support featured images and post thumbnails. Other themes proudly claim to support them, but when you try to display your images the functionality provided is somewhat broken. So the best thing you can do is to implement this feature by yourself. Let's see how.
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.
WPUtils: a jQuery utility for Wordpress
WPUtils (now in its first version) is a jQuery utility to hook into a Wordpress site. I've created this utility to help developers with attaching actions to specific Wordpress sections. For that reason, WPUtils features several helper functions that check if we're on a specific Wordpress page. Let's see the details.
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.
jQuery: Wordpress dynamic menu
Yesterday evening I found a nice Wordpress theme with an interesting, cursor-driven effect on the main menu made with CSS. I decided to recreate it with the aid of jQuery in order to get the maximum benefit from its effects. Let's see the details.