Category: WordPress

get_posts caution!

Note: get_posts uses 'suppress_filters' => true as default, while query_posts() applies filters by default, this can be confusing when using query-modifying plugins, like WPML.

Conditional CSS for IE

wp_enqueue_style(
   'ie7-style',
   get_template_directory_uri() . '/ie7.css'
);
global $wp_styles;
$wp_styles->add_data( 'ie7-style', 'conditional', 'lte IE 7' );

Default to no link on images

This goes into the functions.php file or similar:

//remove auto-links on media
update_option('image_default_link_type','none');