'

Ultimate WordPress body_class function

I wasn’t happy with the default body_class() function in WordPress. I wanted to assign more classes to the body element in order to target various sections or specific pages across the website, so that to style them appropriately. Filtering the body_class() function is a common practice and I found several resources to help me in the task. I started playing [...more]

Does WordPress fail to upgrade or upload?

I had recently an issue on one of my customers website which puzzled me. I was getting an error while uploading a new media or if I tried to automatically update plugins. I was getting an ungraceful error. Warning: touch() [function.touch]: Unable to create file /home/user/public_html/website/wp-content/tmp/filename.tmp because No such file or directory in /home/user/public_html/website/wp-admin/includes/file.php on line 177 Warning: unlink(/home/user/public_html/website/filename.tmp) [function.unlink]: [...more]

How to implement LESS in WordPress, first approach

How to implement LESS in Wordpress, first approach

I recently discovered LESS, as defined by its creator “The dynamic stylesheet language”. A method to write CSS using variables, functions and improved classes. I fell immediately in love with it and I pondered about how to implement LESS into my WordPress development and workflow. In fact I want my new themes to be responsive and if I’m right in [...more]

You don’t need TimThumb, use add_image_size for Thumbnails

matrioska

How to use add_image_size and the_post_thumbnail in our themes. Being TimThumb still an excellent plugin, it’s time to give him a break: we have better ways to manage thumbnails in WordPress. No doubt that TimThumb is a wonderful script. It allowed me to avoid the tangle to re-upload pictures for old articles when switching to a new theme. I thought [...more]

Sanitize the Google Analytics Tracking Code

Stay Safe with the Google Analytics Tracking Code

Is it a safe practice to let users copy and paste any kind of Javascript, assuming they’ll just use a tracking code? How can you validate such a code and keep it safe from malicious scripts? I decided to take a different approach, I accept (and validate) only an ID. The last day I had a thought, perhaps naive, but [...more]

Introducing Loop Magic

Loop Magic is an approach to the WordPress loop. It has the purpose to reduce duplications of the code, keeping the theme slim and simple. It accounts for all the different loops a theme may need to perform, keeping the control room in one unique location. This should ensure better management. WordPress is organized in several key files, each with [...more]

Google Syntax Highlighter Reloaded

Not happy with methods and plugins to highlight codes, I’m presenting a solution to load the scripts only where necessary, aiming to deliver soon a proper plugin for WordPress. As quick note, I realized that the task may need a proper plugin. I’m working on it and I’ll publish something about in the next days. Stay tuned. After few test, [...more]

301 Redirection in WordPress, wp_redirect Explained

301 Redirection Made Even Simpler, wp_redirect Explained

What is the difference between a 301 and a 302 redirection? In this article I explain how to implement such a thing in the Dashboard. With few SEO tips. Never let your visitors clueless when they’re looking for a resource that has been moved. I’m going to show few ways to implement the function wp_redirect provided by WordPress, supported by [...more]

301 Redirect Made Simple

301 Redirection Made Simple

How to rescue your lost visitors when a page has been moved to a different location? And how to not loose any SEO value? We’re seeing two simple methods to achieve such a goal, via the .htaccess file, and with a template page plus a minimal PHP coding. But first what’s a 301 redirection? Note, you would like to give [...more]

WordPress, save your client from the danger nested in the Dashboard

Wordpress, saving the user from the danger nasted in the Dashboard

It happened again. The client asked for an admin access and now hours of fine tuning are gone. Even worse, the website is not that good looking as you planned it to be and you don’t really feel like to have it in your precious portfolio. Too bad. Providing an administrator access to the client is a honest practice. Just [...more]

Page 1 of 212