Advertisement
srikat

Untitled

Aug 26th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. add_action( 'wp_head', 'sk_customizer_css' );
  2. /**
  3. * Writes the Home Top background image out to the 'head' element of the document
  4. * by reading the value from the theme mod value in the options table.
  5. */
  6. function sk_customizer_css() {
  7. ?>
  8. <style type="text/css">
  9. <?php
  10. $sk_home_top_background_image_url = wp_get_attachment_url( get_theme_mod( 'sk_home_top_background_image' ) );
  11. if ( 0 < count( strlen( ( $sk_home_top_background_image_url ) ) ) ) { ?>
  12. .home-top {
  13. background-image: url( <?php echo $sk_home_top_background_image_url; ?> );
  14. }
  15. <?php } // end if ?>
  16. </style>
  17. <?php
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement