Style author comments in WordPress 2.7

December 31, 2008

Due to the new comments system in WordPress 2.7, and the wp_list_comments() function, you have to change the way you style author comments. With previous WordPress versions, you had to use some hacks to be able to give a special style to author comments. But this isn’t needed with the brand new WordPress 2.7: A specific CSS class is automatically added by WP to author and registered users comments. To style author and registered users on WordPress 2.7, simply paste the following code in your style.css file, and style at... [Read the full story]

Publish the Feed of wordpress Later

December 30, 2008

Did you ever published an article, and immediately notice an error? You can edit it, but there’s another problem: The article has already been published on your rss feed. To avoid that kind of problem, we can create a delay between post publication and availability throught rss feeds. WordPress works with a special query, which acts differently depending on the user rights. It is always saved in the variable $where and differently assembled. That means, you can extend it. If you look at the possibilities of mySQL,... [Read the full story]

Embed CSS in your wordpress posts with a custom field

December 29, 2008

Sometimes, a specific post needs to be styled with some custom css styles. You can directly embed CSS in your post, but that not very clean. In this recipe, we will show you how to embed css in a clean way, by using a custom field. First, open your header.php file and insert the following code between the <head> and </head> html tags:   <?php if (is_single()) { $css = get_post_meta($post->ID, 'css', true); if (!empty($css)) { ?> <style type="text/css"> <?php echo... [Read the full story]

Highlight the current category of wordpress

December 29, 2008

Most wordpress readers like to know where they are on a website. To help them knowing what they’re exactly browsing right now, you should definitely highlight the current category. It is very easy to do. When you’re browsing a category, WordPress automatically add a current-cat css class to the <li> element. So the only thing you have to do is to edit your style.css file and add a style for the current-cat class: #nav .current-cat{ background:#999; color:#222; text-decoration:underline; } Now your... [Read the full story]

Make your wordpress title tag SEO friendly

December 29, 2008

SEO is a very important part of your wordpress blog. Because without a good SEO, you’re loosing lots of potential visitors. In this recipe, we will know how to optimise the title of your wordpress blog for a better SEO. Open your header.php file for edition. find the <title> tag, and replace it by the following code:   <title> <?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); } elseif (is_single() ) { single_post_title(); }... [Read the full story]