muqeetsoomro
Member
Posted 1 year ago #
Hi!
I had worst complains but HTML which run in my posts and damage the template of blog. I search about to strip HTML tags I got following code
that put in single.php of theme.
<?php
ob_start();
the_content(''.__('Read more <span class="meta-nav">ยป</span>', 'sandbox').'');
$old_content = ob_get_clean();
$new_content = strip_tags($old_content, '<p><a><b><br /><input><form><img><textarea><li><ol><ul><table>');
echo $new_content;
?>
I get this code from http://wordpress.org/support/topic/way-to-strip-html-from-the_content-1?replies=6
This work fine for me but remove ad sense / other scripts that are present in posts. I search about this but no clue find.
please help me
http://php.net/manual/en/function.strip-tags.php
you possibly need to extend the exempted tags to include <script> and whatever tags are in the adsense/scripts
muqeetsoomro
Member
Posted 1 year ago #
I use "<script>" tag in allowed but adsense codes does not appear
what is the output of the code?
does the script code appear in the output?
can you post a link to a post with the problem?
can you paste the full code of single.php into a http://pastebin.com/ and post the link to it here? (see http://codex.wordpress.org/Forum_Welcome#Posting_Code )
muqeetsoomro
Member
Posted 1 year ago #
pastebin http://pastebin.com/zSfBZPsE
ads in post don't appear... that is output by using <script>
Again I repeat my Question How I can allow the scripts tag above code