Support » How-To and Troubleshooting » How to have a script in your post?

How to have a script in your post?

  • Hello…
    In the content of my post I want to use a <script>whatever</script> However, when I add it.. it just shows up as a blank. Kinda like it is ignoring it..
    What do I have to do in order to get a script to work in the text? Do I have to use a tag or something?
    Please advise…

Viewing 11 replies - 1 through 11 (of 11 total)
  • I am just checking in to see if any of the gurus can anwer this..
    Kind regards,

    Any chance the makers or someone could come up with a plugin that allows the <script></script> code to work in the post contents of wordpress.
    Currently WP cleans up the code and basically removes it.
    Any help would be appreciated.

    Do you want to display the tags or execute the code?

    I want to execute the code between the tags.. I use Hiveware over at hiveware.com to enkode my email addresses on my sites.. I want to be able to also encode any email addresses that may appear in the content of the posts.
    I do not want to create spam for anyone on my site. Using the encoder stops this..
    Kind regards,

    I’d really like this function too. Judging from the Wiki API page it should not be too hard to impelement this as a filter, applied to comment_author_email and the_author_email. I’m still crap at coding stuff up in PHP though…




    problem is…. how do you execute it?
    First, is this client-side javascript? (I’m guessing so since it’s in script tags)…. Well, you could look at the file that strips out unwanted HTML tags (used to be called kses.php or something like that, not sure what it is these days) and set it to allow the script tag. BUT… that means that it will allow script tags in comments – which some one could exploit.

    Any more information on this? Gurus?
    Kind regards,

    TG, I gather from your comment that a single function in kses.php is used to strip scripts both out of posts and out of comments. Correct?
    Is there a way to apply that filter only to comments but not posts? I think this would solve the problem, as well as the related problem of including php code in a post, which has been discussed on this forum before.
    If there is currently no way to do this I’d like to make it a feature request. Or if posts rely on kses.php in some way (to make Quicktags work?), I would advocate having 2 separate functions, kses-posts.php and kses-comments.php or something along those lines.



    any more progress on this?
    i’d like to insert an image into my posts, then when it is clicked on, run a javascript
    to play a .wmv file in a new window.
    I was able to make it work in b logger, but can’t seem to get it to run in WP.

    yea is there any solution to it?

    Does this help? Using_Javascript

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to have a script in your post?’ is closed to new replies.