Replace wordpress Content in PRE Tags with HTML Entities

May 26, 2010

If you have a website that often display some code on your wordpress, you know the important of converting PRE tag content to their HTML entities. Doing so prevents worlds of possible rendering issues. Just paste the following in your functions.php file. Once saved, it will automatically replace all content within <pre> and </pre> tags by html entities. //replaces pre content with html entities function pre_entities($matches) { return str_replace($matches[1],htmlentities($matches[1]),$matches[0]); } //to... [Read the full story]

Put HTML tags into wordpress post title

May 25, 2010

You don’t want to go putting HTML tags directly into post titles. It might show up OK on your own site, but it can be problematic. For example, your titles through RSS will show the tags as next, not render them, here is almost-as-simple way to go about it. 1. Enter title without HTML 2. Create a custom field “HTML_title” for the title with HTML 3. Output custom field on pages you want the HTML For example, on the single.php page where you would have used <h1><php the_title(); ?></h1> Now... [Read the full story]

Allow HTML in wordpress user profiles

December 5, 2008

Do you run a multi-author blog? If yes, you’re probably upset to be unable to use any html in user profile. Happilly, here’s a little recipe to allow html in user profiles. To be able to use html in user profiles, simply append the following line of code to the functions.php file from your theme. (Create that file if it doesn’t exists) remove_filter('pre_user_description', 'wp_filter_kses'); That’s all, authors are now allowed to use html in their profiles  Read More →