title: I need help to dynamically add an onload function to the body tag
body: <p>I am having trouble having to if statements on my body tag. The if statement i currently have is wordpress function:</p>
  
  <pre><code>&lt;?php echo is_single() ? "&lt;body class='single'&gt;" : "&lt;body&gt;" ; ?&gt;
  </code></pre>
  
  <p>This works fine. The problem is on 1 page I need to have "". 
  So what I did was wrap this in another if statement like so:</p>
  
  <pre><code>&lt;?php if(is_page('map')) : ?&gt; 
  &lt;?php echo "&lt;body onload="initialize()"&gt;" ; ?&gt;
  &lt;?php else : ?&gt;
  &lt;?php echo is_single() ? "&lt;body class='single'&gt;" : "&lt;body&gt;" ; ?&gt;
  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>Apparently my syntax is wrong on the 2nd line, but I can't see why? </p>
  
  <p>Can anyone see where I have gone wrong? Or is there an easier way to achieve this in wordpress?</p>
  
  <p>Thanks in advance, 
  Dean</p>