Welcome to WebmasterWorld Guest from 54.196.214.35

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

question about adding javascript

     
4:14 am on Jul 8, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 24, 2005
posts: 429
votes: 0


I'm helping a friend add code into the HTML view of a page and in HTML view it is ok even when I save it, but if I switch to Visual view, it adds this in some areas --> <![CDATA[

I don't want this code added. It's for an ad network and I am not supposed to edit their code at all. Any input? Thanks
2:16 pm on July 8, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


SO just to be clear. You add the code while in HTML mode, update the page, switch to Visual and there you see the CDATA or do you see it while in HTML mode?

This might have the answer for you: [stackoverflow.com...]



And for those who may not know what CDATA is: [w3.org...]
3:12 pm on July 8, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 24, 2005
posts: 429
votes: 0


Hi, No I go to HTML mode, add the code, save it. In Visual mode I don't see the code at all, but when I go back to HTML mode it has added the CDATA stuff. I visited the link and implemented the code, but I think that is possibly for when users post on pages? What page do I need to update for when I add posts in the admin area?
1:24 pm on July 9, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Mar 31, 2002
posts:7575
votes: 0


I'm not sure exactly. The suggested fix involves editing post-template.php which should address the issue. You could create a custom post-template file and use that instead for each post and this way avoid editing the default file. In either case, I think you'll need to do some research to figure out the best way to modify the files to get what you want.
2:07 am on July 11, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 24, 2005
posts: 429
votes: 0


yeah... looking into this
3:47 pm on July 11, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


This is probably one of the auto thingies Wordpress does - like add paragraph tags when you don't want it to. one of the fixes for that [wordpress.org] (there are many,) but doubt it will help this particular issue. Maybe search for a plugin that removes it. I found one that might do it: TextControl [wordpress.org].
4:03 pm on July 11, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 24, 2005
posts: 429
votes: 0


Thanks rocknbill. I will definitely check it out. I've been at a standstill on this issue for a week.