Add a line break between wordpress sidebar widgets

February 28, 2009

Widgets are great, that is a sure thing. But sometimes, they can be annoying, for exemple when they don’t look the way you want or need. The most common problem seems to be adding a line break between widgets. To add a line break between sidebar widgets, simply open your style.css file and append the following code: .widget{ margin-bottom:25px; } Note that it is possible to add a line break to a specific widget only. You’ll need its css id for that.  Read More →

Get the first image from the wordpress post and display it

February 25, 2009

Most WordPress users are using custom fields to display thumbs on their blog homepage. It is a good idea, but do you know that with a simple php function, you can grab the first image from the post, and display it. You can simply call the function within the loop to display the first image from the post: <?php echo get_first_image() ?> But first, paste this function follow on your functions.php file. function get_first_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output =... [Read the full story]

Disable the update message in wordpress dashboard

February 23, 2009

When a new version of WordPress is available, a message asking you to update your WP installation is displayed on your dashboard. But sometimes you may want to hide this message. To get rid of the “Please update now” message in your WordPress dashboard, simply paste the following code on your functions.php file.   if ( !current_user_can( 'edit_users' ) ) { add_action( 'init', create_function( '$x', "remove_action( 'init', 'wp_version_check' );" ), 2 ); add_filter( 'pre_option_update_core', create_function( '$x',... [Read the full story]

List wordpress future posts

February 22, 2009

Do you ever wished to be able to use WordPress to list future events? This can be very useful for exemple if you’re using WordPress for a band website and like to list your future shows. Just simply paste this code where you’d like you future posts to be displayed:   <div id="livexpft"> <div id="livexpft_header"><p>Future events</p></div> <?php query_posts('showposts=10&post_status=future'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div... [Read the full story]

Display post based on custom fields with a custom query

February 20, 2009

Many blogger interested to know how to be able to display posts based on custom fields values. The first thing to do is to create a page template. The code below will display your posts, based on the following condition: Post must have a custom field with key tag and value email. Of course, you can change it in the query to make the code fits your needs. <?php /* Template Name: Custom query */ $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id ... [Read the full story]