How to Change the Font in HTML Editor In WordPress 3.3

The HTML editor in WordPress 3.3 uses monospace font, which is not really friendly to the eyes. Here’s how to change the font to, say, verdana.

1. Open your theme’s functions.php file.

2. Copy and paste the following code:

add_action( 'admin_head-post.php', 'wpdb_fix_html_editor_font' );
add_action( 'admin_head-post-new.php', 'wpdb_fix_html_editor_font' );
 
function wpdb_fix_html_editor_font() { ?>
    <style type="text/css">
        #editorcontainer #content, #wp_mce_fullscreen, .wp-editor-area {
            font-family: Verdana,Arial,sans-serif!important;
        }
    </style>
<?php }

3. Save the functions.php file back to the server.

That’s it.

How to Remove the Width and Height Attributes From WP Image Uploader

If you upload images via the WordPress image uploader and insert it into your post, it will include the image width and height attribute in the html <img> tag. Here’s what it will look like.

<img src="path/to/your/image" width="123" height="456" class="aligncenter size-full" alt="" title=""/>

In most cases, this is absolutely alright. However, if you are using a responsive theme or are dealing with responsive web design, the “width” and “height” attribute will be a major roadblock that you need to get rid of.

Here’s how you can do it.
Continue reading

How to Edit The Excerpt

Changing the Excerpt length

Paste this code to the functions.php of your theme folder.

function custom_excerpt_length( $length ) {
	return 30; //change this number to determine the number of words returned
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Adding “Read More” link after the excerpt

function new_excerpt_more($more) {
        return '... <span class="read-more"><a href="'. get_permalink($post->ID) . '">Read more  &raquo;</a></span>';
       //if you just want to remove the [...] after the excerpt, use 'return '';'
}
add_filter('excerpt_more', 'new_excerpt_more');

That’s it.