• 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 ‘)”>abcdef

    Any idea why?

    https://www.ads-software.com/plugins/genesis-simple-hooks/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Inserting css with php’ is closed to new replies.