Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ff_get_container_image_attributes() {
- $bgImageType = null;
- $bgImageUrl = null;
- #########################################################################################################
- # ADDITION
- #########################################################################################################
- if( is_dynamically_generated_page() ) {
- $bgImageType = 'image';
- $bgImageUrl = 'PATH_TO_YOUR_IMAGE';
- return ' data-backgroundType="'.$bgImageType.'" data-backgroundImage="'.$bgImageUrl.'" ';
- }
- // is category, single post or single portfolio, but not page
- if( (is_category() || is_singular()) && !is_page() ) {
- $bgImageType = fEnv::getCategoryOption('description_bg_type');
- if( $bgImageType == 'default' )
- return ff_get_container_image_attributes_from_themeopt();
- else if( $bgImageType == 'color') {
- $bgImageUrl = fEnv::getCategoryOption('description_bg_color');
- if( empty($bgImageUrl) )
- $bgImageUrl = 'dddddd';
- $bgImageUrl = '#'.$bgImageUrl;
- } else {
- $bgImageUrl = fEnv::getCategoryOption('description_img');
- if( empty( $bgImageUrl ) ) {
- $bgImageType = 'color';
- $bgImageUrl = '#dddddd';
- }
- }
- } else if( is_page() ) {
- $bgImageType = metaBoxManager::getMeta('description_bg_type');
- if( $bgImageType == 'default' )
- return ff_get_container_image_attributes_from_themeopt();
- else if( $bgImageType == 'color') {
- $bgImageUrl = metaBoxManager::getMeta('description_bg_color');
- if( empty($bgImageUrl) )
- $bgImageUrl = 'dddddd';
- $bgImageUrl = '#'.$bgImageUrl;
- } else {
- $bgImageUrl = metaBoxManager::getMeta('description_bg_image');
- if( empty( $bgImageUrl ) ) {
- $bgImageType = 'color';
- $bgImageUrl = '#dddddd';
- }
- }
- }
- else {
- return ff_get_container_image_attributes_from_themeopt();
- }
- return ' data-backgroundType="'.$bgImageType.'" data-backgroundImage="'.$bgImageUrl.'" ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement