How to Add Text Attribute to Images Tag in Editor

If you have noticed, the title attribute was removed in the image tag in WordPress. It was said that it is useless, redundant, and not necessary to SEO, but some of us would still prefer it to be there as some news aggregator sites, like Google News, still use it for indexing. It is pretty […]

How to Create New Permalink Rules

In WordPress, you can easily create a pretty URL by going to the Settings -> Permalinks section and update the permalink structure. However, if you are creating your own themes or plugins, there are times when you need to create a custom permalink structure. For example: you want to implement a permalink: http://your-site.com/movies/1 which translates […]

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() { ?>

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 […]

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 […]