title: Dynamically change the background image in CSS for different posts in wordpress
body: <p>Is it possible to change the background image called in CSS dynamically for different posts? In short, I am looking to show the featured image of a post in WordPress as background?</p>
  
  <pre><code>background: #253340 url('assets/images/blog/post-2.jpg') no-repeat 50% top;
  </code></pre>
  
  <p>I did try this one find on this forum but didn't work.</p>
  
  <pre><code>background: #253340 url(&lt;?php echo $variable_holding_img_url; ?&gt;) no-repeat 50% top;
  </code></pre>