WordPress.org

Ready to get started?Download WordPress

Forums

Adding Javascript ad code from ad network (10 posts)

  1. D.Duggs
    Member
    Posted 3 years ago #

    Please help! I have tried everything to add a javascript ad code to my header and side bar and nothing is working. I put the code in the header.php and sidebar.php files and when I go to the site all that shows up in its place is "')" I tested the code and it works fine in the preview of the Javascript/HTML widget, but when I save, it doesn't appear on my website.
    http://www.sportsandalatte.com

    Please help me!

    The ad code [header]

    <!-- begin 160x600 Top Sports and a Latte -->
    <script language="JavaScript" type="text/javascript">
    window.dctile = Number(window.dctile) + 1 || 1;
    window.dc_ord = Number(window.dc_ord) || Math.floor(Math.random() * 1E10);
    if (dctile==1) {var vdcopt = 'ist';} else {vdcopt = '';}
    if (17>dctile) document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/yb.sportsandalatte/;chan1=gensports;rating=pg;dcopt=' + vdcopt + ';yb=ad;s1=;s2=;tile=' + dctile + ';sz=160x600;ord=' + dc_ord + '?"><\/script>\n');
    </script>
    <!-- End ad tag -->

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. D.Duggs
    Member
    Posted 3 years ago #

    Thank you, but I am not a developer and I really don't understand what I'm supposed to do. I've tried to follow those, but I don't get it.

    If any one can tell me where I'm supposed to paste the ad code, that would be great.

    With this line,
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/pathto/yourscript.js"></script>

    Am I supposed to replace "yourscript.js" with something from the ad code?

  4. govpatel
    Member
    Posted 3 years ago #

    looked at your where are going to add your ad in header as there not much room for ad 160 by 600

  5. D.Duggs
    Member
    Posted 3 years ago #

    I plan to remove most of the stuff on my sidebar.

    I have the code for a banner ad in the header, a sky scraper on the sidebar and a box/rectangle for the sidebar.

    I just need one to successfully show and I don't know where to paste the code for the sidebar.

  6. govpatel
    Member
    Posted 3 years ago #

    try using the text widget for side bar

  7. D.Duggs
    Member
    Posted 3 years ago #

    I tried that as well and it doesn't work.

    I don't know if I'm missing something in the code or what.

  8. govpatel
    Member
    Posted 3 years ago #

    Ijust put same code you have on my test wordpress using text widget and is working fine check it out

    http://govpatel.com/wordpress

  9. D.Duggs
    Member
    Posted 3 years ago #

    wow, hmmm wonder why it's not working for me. Perhaps it's the theme I'm using? Would that be an issue?

  10. D.Duggs
    Member
    Posted 3 years ago #

    Problem Solved, it was my theme :-(

    I really liked the theme I was using... wonder how I could work around this issue.

    Thanks everyone

Topic Closed

This topic has been closed to new replies.

About this Topic