Remove curly quotes from your wordpress comments

January 4, 2009

How to remove curly quotes on your comments? Simply paste the following line of code on the functions.php file from your theme. remove_filter('comment_text', 'wptexturize'); That’s easy as that!  Read More →

Display a random post in your wordpress blog sidebar

January 4, 2009

If you want to display a random post in your wordpress blog sidebar, simply paste the following code on the sidebar.php file of your theme: <?php query_posts(array('orderby' => 'rand', 'showposts' => 1)); if (have_posts()) : while (have_posts()) : the_post(); the_title(); the_excerpt(); endwhile; endif; ?> Then your sidebar will display a random post on each of your wordpress blog pages.  Read More →

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]