Posts Tagged ‘Wordpress’
This appears to be a very common request from people working with Wordpress blogs and here we have what I consider the most elegant solution.
The problem: Wordpress displays the title of a blog in the header section even if there is an underlying graphic that is meant to replace the text title.
The solution: In the template being used, add the following line anywhere in the style.css file:
#header h1 { display:none }
To be sure, there are other methods of removing the textual title, but they have their problems. For instance, just deleting the title name from the Wordpress admin interface has the effect of displaying no title name on the browser window and the title will also not show in search engines and rss feeds. Another possibility is editing the header.php file to remove the title display, but again, the browser wouldn’t display the title either. Editing the css rather than the php has the benefit of having no bad side-effects.
I really needed to be able to contain MXML markup code in my Flex blog, yet Wordpress MU (Multi-user) has some HTML and Javascript filtering in effect for security purposes. Since my blogs aren’t used by others, I figured it would be safe to disable that functionality, but it really is not the easiest thing to achieve.
I searched on Google and found a blog dealing with the matter at http://dev.robertmao.com/2007/07/18/get-rid-of-boring-wpmus-post-htmljavascript-filtering/. Since the blogger’s English wasn’t the greatest, I figured I can offer similar information here, hopefully, in a way that is easier to understand.
To achieve this, a very slight modification of one of WPMU’s (Wordpress Multi-user) PHP files, kses.php, which resides in the wp-include folder, will be necessary to achieve this. Using any plain text editor with a basic search function should suffice to edit the file.
Doing a simple text search of wp-include/kses.php for the word “filtering” should yield something similar to the following:
1028 1029 1030 1031 1032 1033 1034 1035 1036 | 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'); |
To remove the HTML/Javascript filtering, just comment out the add_filter lines below the // Post filtering by inserting a set of // backslashes, resulting in the following:
1028 1029 1030 1031 1032 1033 1034 1035 1036 | 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'); |
As of this writing, the version of WPMU is 2.6.3, so these lines will reflect that version, though the search for the keyword “filtering” should still yield similar results in other versions.