I’d suggest nixing the visual rich editor (Users > Your Profile, Personal Options) and see if you can insert the code using the basic editor.
Unfortunally it doesn’t work. I tried this, with adding the html directly in the database, but with showing the content, wordpress is again adding some <p> and <br>
Are you trying to paste javascript into a post? If so, try using my little plugin to help this along.
http://ottodestruct.com/wpstuff/scriptenabler.zip
It should prevent WordPress from messing with your javascripts.
Well, it is not really javascript. I use some functions, but I included them (directly in the source. It is not a nice solution, but it works), but the data hava to be specified in html (I use the gmapez tool). For example:
http://bluweb.com/us/chouser/gmapez/start.html
To add a marker to my google map (with gmapez), I use:
<div class=”GMapEZ” style=”width: 300px; height: 300px;”>
</div>
But WP is messing this by adding <P> and <BR> tags.
Also drawing a line with gmapez is the
and
- tag. WP is also messing this up…
But Otto, your script looks interesting. Is it possible to extend or change the script that wordpress doesn’t mess up my html??
for example everything between an artificial <nomess> tag:
<nomess>
<div>some data that should not be messed up</div>
EXTENT
</nomess>
I don’t know so much about the inner structure of wordpress (there are so many functions). Do you know how I should do that?
hmzz. now is the link interpreted as a link: There should be the html of a link, like in gmapez…
But Otto, your script looks interesting. Is it possible to extend or change the script that wordpress doesn’t mess up my html??
Sure. Open the plugin in a text editor. There’s two functions, a Pre and a Post. The Pre takes out the relevant code before WordPress messes with it, and the Post puts it back afterwards. If you wanted to have a “nomess” sort of tag, you could change the regular expressions accordingly.
In the Pre, you’ll find this:
if (preg_match_all("{\<script(.*)\<\/script\>}siU", $text, $temp)) {
Change that to this:
if (preg_match_all("{\<nomess\>(.*)\<\/nomess\>}siU", $text, $temp)) {
Now it looks for nomess tags. You just have to fix the post portion to put the stuff back correctly. So in there, find this:
$text = str_replace('<!-- h'.$k.'h -->', '<script'.$v.'</script>', $text);
And change it to this:
$text = str_replace('<!-- h'.$k.'h -->', $v, $text);
That will put the text back into your post, but WITHOUT the nomess tags.
Should work, I think. Haven’t tried it. 🙂
And if you want a super simple way to insert google maps, try Windows Live Writer: blog page at http://windowslivewriter.spaces.live.com/ and download link at http://g.msn.com/8SEENUS030000TBR/WriterMSI