title: wordpress advanced custom fields background image
body: <p>I am trying to set an image uploaded through custom fields plugin and have it display as the background of a div (which is used in a slider).</p>
  
  <p>However the image is not displaying...I have text in the custom fields and that is showing okay so I think its something to do with the line of code I am using to pull in the image.</p>
  
  <p>I am trying to set the background of .slide1 with the image.</p>
  
  <p>The custom field name is slide1_background.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="slide1" style="background-image:url('&lt;?php the_field('slide_bg1'); ?&gt;');"&gt;
  &lt;div class="slide1-cont"&gt;&lt;p class="slide-text"&gt;
  &lt;h1&gt;&lt;?php the_field('slide_title1'); ?&gt;&lt;/h1&gt;
  &lt;img src="&lt;?php bloginfo('template_directory')?&gt;/images/line.png" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;?php the_field('slide_content1'); ?&gt;&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.slide1{
  background-repeat:no-repeat;
  background-size:cover;
  background-position:center;
  height: 800px;
  }
  </code></pre>