Advertisement
Guest User

Untitled

a guest
May 3rd, 2013
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. function ff_get_container_image_attributes() {
  2.     $bgImageType = null;
  3.     $bgImageUrl = null;
  4. #########################################################################################################
  5. # ADDITION
  6. #########################################################################################################
  7.     if( is_dynamically_generated_page() ) {
  8.         $bgImageType = 'image';
  9.         $bgImageUrl = 'PATH_TO_YOUR_IMAGE';
  10.         return ' data-backgroundType="'.$bgImageType.'" data-backgroundImage="'.$bgImageUrl.'" ';
  11.     }  
  12.    
  13.     // is category, single post or single portfolio, but not page
  14.     if( (is_category() || is_singular()) && !is_page() ) {
  15.        
  16.         $bgImageType = fEnv::getCategoryOption('description_bg_type');
  17.         if( $bgImageType == 'default' )
  18.             return ff_get_container_image_attributes_from_themeopt();
  19.         else if( $bgImageType == 'color') {
  20.             $bgImageUrl = fEnv::getCategoryOption('description_bg_color');
  21.             if( empty($bgImageUrl) )
  22.                 $bgImageUrl = 'dddddd';
  23.             $bgImageUrl = '#'.$bgImageUrl;
  24.         } else {
  25.             $bgImageUrl = fEnv::getCategoryOption('description_img');
  26.             if( empty( $bgImageUrl ) ) {
  27.                 $bgImageType = 'color';
  28.                 $bgImageUrl = '#dddddd';
  29.             }
  30.         }
  31.        
  32.     }   else if( is_page() ) {
  33.         $bgImageType = metaBoxManager::getMeta('description_bg_type');
  34.         if( $bgImageType == 'default' )
  35.             return ff_get_container_image_attributes_from_themeopt();
  36.         else if( $bgImageType == 'color') {
  37.             $bgImageUrl = metaBoxManager::getMeta('description_bg_color');
  38.             if( empty($bgImageUrl) )
  39.                 $bgImageUrl = 'dddddd';
  40.             $bgImageUrl = '#'.$bgImageUrl;
  41.         } else {
  42.             $bgImageUrl = metaBoxManager::getMeta('description_bg_image');
  43.             if( empty( $bgImageUrl ) ) {
  44.                 $bgImageType = 'color';
  45.                 $bgImageUrl = '#dddddd';
  46.             }
  47.         }
  48.        
  49.     }
  50.     else {
  51.         return ff_get_container_image_attributes_from_themeopt();
  52.     }
  53.    
  54.     return ' data-backgroundType="'.$bgImageType.'" data-backgroundImage="'.$bgImageUrl.'" ';
  55.    
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement