bp_dtheme_header_style

The styles for the post thumbnails / custom page headers.

Description

bp_dtheme_header_style(); 

Referenced via add_custom_image_header() in bp_dtheme_setup().


Usage

  1. if ( !function_exists( 'bp_dtheme_header_style' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-themes/bp-default/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_dtheme_header_style(); 
  7.  

Defined (1)

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

/bp-themes/bp-default/functions.php  
  1. function bp_dtheme_header_style() { 
  2. global $post; 
  3.  
  4. $header_image = ''; 
  5.  
  6. if ( is_singular() && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) { 
  7. $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ); 
  8.  
  9. // $src, $width, $height 
  10. if ( !empty( $image ) && $image[1] >= HEADER_IMAGE_WIDTH
  11. $header_image = $image[0]; 
  12. else 
  13. $header_image = get_header_image(); 
  14.  
  15. } else { 
  16. $header_image = get_header_image(); 
  17. ?> 
  18.  
  19. <style type="text/css"> 
  20. <?php if ( !empty( $header_image ) ) : ?> 
  21. #header { background-image: url(<?php echo $header_image ?>); } 
  22. <?php endif; ?> 
  23.  
  24. <?php if ( 'blank' == get_header_textcolor() ) { ?> 
  25. #header h1, #header #desc { display: none; } 
  26. <?php } else { ?> 
  27. #header h1 a, #desc { color:#<?php header_textcolor(); ?>; } 
  28. <?php } ?> 
  29. </style> 
  30.  
  31. <?php