简体   繁体   中英

Trying to add a javascript ad to a single wordpress post

I'm new to javascript, so please bear with me. I'm trying to insert the following javascript ad

<script type="text/javascript">
guh=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language=\'JavaScript1.1\' SRC=\"http://ad.doubleclick.net/adj/N8493.3871.VALUECLICKMEDIA/B7858697.4;sz=300x250;click=http://cpadna1.com/?E=SY5O2%2fi8VAfDIPQpCyNY2w%3d%3d&s1=&ckmrdr=http%3A//www.alpinedrct.com/click.track%3FCID%3D245964%26AFID%3D136557%26ADID%3D1036808%26NonEncodedURL%3D;ord='+guh+'?\"></scr' + 'ipt>');
</script>

into a wordpress post. It never appears when I publish it.

From my research it looks like my best bet was to use this plugin: http://wordpress.org/plugins/custom-fields-shortcode/ but the ad didn't show up.

I also tried putting the script in the custom field section and inserted it into the post. Still no luck.

Could you please point me in the right direction for what I should be looking into? Thanks for any help.

So, a few things. I have had the same issue recently.

  1. First of all, you want to make sure you are placing it in the code view.

  2. Wordpress can block scripts in your posts, so you need to install the Text Control plugin, which overrides the blocking.

  3. Finally, try debugging the script.

You could also try adding it to the themes code.

Here is a link that I found helpful on this issue.
Another one, this time from Wordpress.org.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM