ThemeShaper Forums » Thematic

[closed]

Woudl this work to add javascript into the head of a child theme?

(3 posts)
  • Started 10 years ago by willforsyth
  • Latest reply from willforsyth
  • This topic is resolved
  1. I am wanting to place a link for an affiliate site into corner of my site with javascript.

    Would this work to add the code into the head of the theme?

    function digital summer(){
     echo '<script type="text/javascript" language="javascript">document.write('<style type="text/css">body{position:relative;}</style><div style="position: absolute; top:0px; right:0px; width:156px;height:155px;"><img src="http://www.gatesheaddigitalsummer.com/build/images/gds-badge.png" border="0" width="156" height="155"/></div>');<!--/End of GDS Badge. Thanks for the support! --></script>';
    }
    add_action('wp_head', 'digital summer');

    thanks

    Posted 10 years ago #
  2. don't need the echo. And sorry in advance for my lack of forum formatting knowledge.

    //add javascript  
    
    	function digital_summer(){ ?>
              <script type="text/javascript" language="javascript">document.write('<style type="text/css">body{position:relative;}</style><div style="position: absolute; top:0px; right:0px; width:156px;height:155px;"><img src="http://www.gatesheaddigitalsummer.com/build/images/gds-badge.png" border="0" width="156" height="155"/></div>');<!--/End of GDS Badge. Thanks for the support! --></script>
       <?php }
    
    	add_action('wp_head', 'digital_summer');
    Posted 10 years ago #
  3. ah thanks wondered why it crashed my install .

    Posted 10 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.