Title: Inserting css with php
Last modified: August 24, 2016

---

# Inserting css with php

 *  [rvnd](https://wordpress.org/support/users/rvnd/)
 * (@rvnd)
 * [11 years ago](https://wordpress.org/support/topic/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 **‘)”>abcdef**
 * Any idea why?
 * [https://wordpress.org/plugins/genesis-simple-hooks/](https://wordpress.org/plugins/genesis-simple-hooks/)

Viewing 1 replies (of 1 total)

 *  [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [11 years ago](https://wordpress.org/support/topic/inserting-css-with-php/#post-6078783)
 * Background images are implemented through CSS vs injecting an image tag into 
   the output.
 * For site customization post threads at [http://www.studiopress.com/forums/](http://www.studiopress.com/forums/).

Viewing 1 replies (of 1 total)

The topic ‘Inserting css with php’ is closed to new replies.

 * ![](https://ps.w.org/genesis-simple-hooks/assets/icon-256x256.png?rev=1335659)
 * [Genesis Simple Hooks](https://wordpress.org/plugins/genesis-simple-hooks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/genesis-simple-hooks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/genesis-simple-hooks/)
 * [Active Topics](https://wordpress.org/support/plugin/genesis-simple-hooks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/genesis-simple-hooks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/genesis-simple-hooks/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/inserting-css-with-php/#post-6078783)
 * Status: not resolved