By default, the body_class() function adds some class to the <body> tag to allow you to style your site more easily. But unfortunely, no extra class is added when your template has a sidebar. Here is a imple function to solve this problem.
By default, the body_class() function adds some class to the <body> tag to allow you to style your site more easily. But unfortunely, no extra class is added when your template has a sidebar. Here is a imple function to solve this problem.
Who do not like free stuff? Today, I’m glad to announce a new giveaway on WPRecipes: Enter the contest and try to win 5 WP Theme Generator licences. The only thing you have to do is to tweet about WP Theme Generator.
By default, WordPress do not add a <meta description> tag to your blog. While not necessary, some SEO experts insists that this tag is important for your site SEO. So what about generating one using your post content? Here is a cool piece of code to do it easily.
When you upload images via WordPress image uploader and insert it into your posts, WordPress automatically include the image width and height attributes in the html <img> tag. But when using a responsible theme, this can cause lots of trouble. Here’s a quick recipe to get rid of those attributes.
When developing a WordPress theme, you often want to rely on a plugin. For example, I have seen many themes which relied on the Wp-PageNavi plugin for their pagination. But if the end user do not have the plugin installed, the code is broken and you can’t use the theme. Happily, there’s a WP function named is_plugin_active() that you can use to test if a plugin is active.
What about giving a new life to your old posts by creating a page template that will redirect readers to a random post? Today, I’m going to show you how to easily create this kind of page.
By default, WordPress automatically checks if plugins updates are available, and if yes, ask you to install it. It is useful in most cases, but when building websites for clients you may not want them to updates plugins, for example if you modified a plugin especially for them. Here is an easy way to disable plugin updates on any WordPress blog.