Skip to content

Month: October 2011

How to disable wordpress html filter for posts and pages?

In some versions of WordPress there is a filter that strips some tags from the html code. If you want to remove this filter just open wp-includes/kses.php and find this row:

function kses_init_filters() {
    // Normal filtering.
    add_filter('pre_comment_content', 'wp_filter_kses');
    add_filter('title_save_pre', 'wp_filter_kses');

    // Post filtering
    add_filter('content_save_pre', 'wp_filter_post_kses');
    add_filter('excerpt_save_pre', 'wp_filter_post_kses');
    add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}

and comment out the rows that you need:

function kses_init_filters() {
    // Normal filtering.
    add_filter('pre_comment_content', 'wp_filter_kses');
    add_filter('title_save_pre', 'wp_filter_kses');

    // Post filtering
    //add_filter('content_save_pre', 'wp_filter_post_kses');
    add_filter('excerpt_save_pre', 'wp_filter_post_kses');
    //add_filter('content_filtered_save_pre', 'wp_filter_post_kses');
}

Then if you save the post in html it’s OK, but if you switch to normal view and then go back to html view the tags could be stripped again. This hapens most likely from the MCE Editor and to resolve this issue you could install a plugin called TinyMCE Valid Elements or some similar plugin.

How to check shutter (shots) count on your photo camera?

Visit: http://regex.info/exif.cgi/ and http://scent.org/cgi-bin/exif.cgi
Just choose the image from your computer or URL and check the info. You can check a lot of Exif info from your image taken from shutter speed, aperture, ISO, shutter count and so on.

I have tested the first link for my Nikon D90 and it works.

Alternatively you can install a software called Opanda and check this info on your PC – http://www.opanda.com/en/iexif/download.htm

How to add extra sidebar to a WordPress theme?

To begin the tutorial, extract your theme into a folder and open it to see all the files. If your theme has only one sidebar, then most probably you will NOT find a file called functions.php in your theme folder. In that case you will have to create this file yourself. Just open notepad or any other code editor to start a new file. Put this code into that file:

Problem with category slug renaming in WordPress

I had a problem. I couldn’t change the category slug in some of my categories. So I found the solution at:

http://wordpress.org/support/topic/category-slug-cant-be-updated

The problem comes from the fact that the tags and categories are stored in the same table in the database. And the tags also have slugs. So if there is already a tag with the slug that you want to put in the category you can’t do it until you delete the tag or change it’s slug.

You just need to go to the tags table in the admin panel and change the tag slug that’s making the problem.

Standart banner sizes

Name Width / px Height / px Aspect ratio
Rectangles and Pop-Ups
Medium Rectangle 300 250 1.2
Square Pop-Up 250 250 1
Vertical Rectangle 240 400 1.67
Large Rectangle 336 280 1.2
Rectangle 180 150 1.2
3:1 Rectangle 300 100 3
Pop-Under 720 300 2.4
Banners and Buttons
Full banner 468 60 7.8
Half banner 234 60 3.9
Micro bar 88 31 2.84
Button 1 120 90 1.33
Button 2 120 60 2
Vertical banner 120 240 2
Square button 125 125 1
Leaderboard 728 90 8.09
Skyscrapers
Wide skyscraper 160 600 3.75
Skyscraper 120 600 5
Half page ad 300 600 2

Sizes in bold are part of the IAB’s Universal Ad Package.

For more info go to:

http://www.bannercreator.nu/banner-size.html

http://en.wikipedia.org/wiki/Web_banner