Inserting css with php
-
I’ve added this code to show the featured image hooking in to Above Header. The image will show fine, but not when I try and make it a background image.
This is the code:
<?php $pic = get_the_post_thumbnail( $post_id, $size, $attr ); echo $pic; ?> <div style="padding:20px; background-color:silver; background-image: url('<?php echo $pic; ?>')">abcdef</div>
Line 2 displays properly.
Line 3 displays ‘)”>abcdefAny idea why?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Inserting css with php’ is closed to new replies.