コード例 #1
0
     $section_style_attr .= 'margin-bottom:' . $margin_bottom . 'px;';
 }
 /* background */
 if (!empty($tmm_layout_constructor_row[$row]['bg_type']) && $tmm_layout_constructor_row[$row]['bg_type'] !== 'none') {
     if ($tmm_layout_constructor_row[$row]['bg_custom_type'] == 'image' && !empty($tmm_layout_constructor_row[$row]['bg_image'])) {
         $section_class .= ' parallax';
         $section_style_attr .= 'background-image: url(' . $tmm_layout_constructor_row[$row]["bg_image"] . ');';
         if (!empty($tmm_layout_constructor_row[$row]['bg_attachment'])) {
             $section_class .= ' bg-scroll';
         }
     }
     if ($tmm_layout_constructor_row[$row]['bg_custom_type'] == 'image' && !empty($tmm_layout_constructor_row[$row]['overlay'])) {
         $display_overlay = true;
         $overlay_style_attr = '';
         if (!empty($tmm_layout_constructor_row[$row]['bg_overlay_color'])) {
             $overlay_style_attr .= TMM_Content_Composer::hex2RGB($tmm_layout_constructor_row[$row]['bg_overlay_color'], true);
         } else {
             $overlay_style_attr .= '0,0,0';
         }
         if (isset($tmm_layout_constructor_row[$row]['bg_overlay_opacity'])) {
             $overlay_style_attr .= ',' . intval($tmm_layout_constructor_row[$row]['bg_overlay_opacity']) / 100;
         } else {
             $overlay_style_attr .= ',1';
         }
         if (!empty($overlay_style_attr)) {
             $overlay_style_attr = ' style="background-color:rgba(' . $overlay_style_attr . ')"';
         }
     }
     if ($tmm_layout_constructor_row[$row]['bg_custom_type'] == 'video' && !empty($tmm_layout_constructor_row[$row]['bg_video'])) {
         $video_type = TMM_Layout_Constructor::get_video_type($tmm_layout_constructor_row[$row]['bg_video']);
         $top = $post->post_type == 'page' && empty($post->post_content) && $first_row['bg_custom_type'] == 'video' ? '0' : '100px';