In Wordpress, I try to set the background of a div dynamically by using the post-thumbnail url in a style parameter. I put the style-parameter in a variable, named style. If I echo $style directly, it outputs:
style="background: url("http://localhost/test/wp-content/uploads/2012/11/potloden_120px.png") cover no-repeat;"
But if I echo $style in the div, like so:
<div class="column" <?php echo $style; ?>>
I get the following output:
<div class="column" style="background: url(" http:="" localhost="" test="" wp-content="" uploads="" 2012="" 11="" potloden_120px.png")="" cover="" no-repeat;"="">
Does anyone now what causes this? How should I adept my syntax for this to work?