WordPress is great for blogs, and of course commenting is an essential part of blogging. Your blog readers can post comments with HTML tags. For their convenience, you can display a list of all allowed HTML tags in the comments form using the following PHP code in functions.php:
[php]
Allowed tags: <?php echo allowed_tags(); ?>
[/php]
Change Allowed HTML Tags
You can also change what HTML tags are allowed in your comments form.
Edit functions.php (located in your wp-content/themes/ directory) and append the following code:
[php]
/*
* only allow <strong>, <em>, pre, code, and <a href=""> tags
*/
add_action(‘init’, ‘my_html_tags_code’, 10);
function my_html_tags_code() {
define(‘CUSTOM_TAGS’, true);
global $allowedposttags, $allowedtags;
$allowedposttags = array(
‘strong’ => array(),
’em’ => array(),
‘pre’ => array(),
‘code’ => array(),
‘a’ => array(
‘href’ => array (),
‘title’ => array ())
);
$allowedtags = array(
‘strong’ => array(),
’em’ => array(),
‘pre’ => array(),
‘code’ => array(),
‘a’ => array(
‘href’ => array (),
‘title’ => array ())
);
}
[/php]
If you enjoyed this post, make sure to subscribe to WPMayor’s RSS feed.
9 Responses
Yes, But if you are looking where to advertise your business online, I have an online to tool to introduce, the iConnect10 – wherein you can build your business, and get paid!!
Excellent! This post have just solved my problem. Thank you kindly!
than you for this code. I am finding this one. best coding site
nice job…exatly was searching fr the same…
Looking for a job as service provider? Post your skills to become a service provider. Hundreds of work categories including: Delivery – Cleaning – Recycling – Shopping – Handyman – Catering – Plumbing – Computer Help – Website Design – Writing – Tutoring – Pet Sitting – Child Care – Gardening
Are you looking for permanent employment? Search over 1 million job listings. From executive jobs to temporary work
Labor Bazaar Is A Social Network Driven Labor Marketplace
Visit: Laborbazaar.com
This is helpful indeed.
I’ll try and see if it works…I hope I won’t mess up my theme’s functions.php CSS code 😛
Thanks for the tutorial
great tutorrials are shared thanks for this
html color name
ok,very goog thank you