Skip to content

Instantly share code, notes, and snippets.

@oleksapro
Created April 10, 2015 13:03
Show Gist options
  • Save oleksapro/630c8ec791013981e39e to your computer and use it in GitHub Desktop.
Save oleksapro/630c8ec791013981e39e to your computer and use it in GitHub Desktop.
PHP:
<?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); ?>
HTML:
<div style="background-image: url('<?php echo $background[0]; ?>');">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment