minileven_show_background_and_header_color

This function displays the custom background image or color, and custom text color.

Description

minileven_show_background_and_header_color(); 

Usage

  1. if ( !function_exists( 'minileven_show_background_and_header_color' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/minileven/theme/pub/minileven/inc/custom-header.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = minileven_show_background_and_header_color(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/minileven/theme/pub/minileven/inc/custom-header.php  
  1. function minileven_show_background_and_header_color() { 
  2. $background = minileven_get_background(); 
  3. $header_text = minileven_header_text_display(); 
  4.  
  5. $style = ''; 
  6.  
  7. if ( $background['color'] || $background['image'] ) : 
  8. $style = $background['color'] ? "background-color: #$background[color];" : ''; 
  9.  
  10. if ( $background['image'] ) : 
  11. $image = " background-image: url('$background[image]');"; 
  12.  
  13. if ( ! in_array( $background['repeat'], array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) 
  14. $background['repeat'] = 'repeat'; 
  15. $repeat = " background-repeat: $background[repeat];"; 
  16.  
  17. if ( ! in_array( $background['position'], array( 'center', 'right', 'left' ) ) ) 
  18. $background['position'] = 'left'; 
  19. $position = " background-position: top $background[position];"; 
  20.  
  21. if ( ! in_array( $background['attachment'], array( 'fixed', 'scroll' ) ) ) 
  22. $background['attachment'] = 'scroll'; 
  23. $attachment = " background-attachment: $background[attachment];"; 
  24.  
  25. $style .= $image . $repeat . $position . $attachment; 
  26. endif; 
  27. endif; 
  28. ?> 
  29. <style type="text/css"> 
  30. <?php if ( $style ) { ?> 
  31. body { 
  32. <?php echo trim( $style ); ?> 
  33. <?php } ?> 
  34. #page,  
  35. #branding { 
  36. margin: 0.6em 0.6em 0.8em; 
  37. #site-generator { 
  38. border: 0; 
  39. <?php if ( 'blank' != $header_text && '1' != get_option( 'wp_mobile_header_color' ) ) : ?> 
  40. /* If The user has set a header text color, use that */ 
  41. #site-title,  
  42. #site-title a { 
  43. color: #<?php echo $header_text; ?>; 
  44. <?php endif; ?> 
  45. </style> 
  46. <?php