Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 68700489c2690a446d3004a56ac4f22a12936f6a Mon Sep 17 00:00:00 2001
- From: Shirkit <[email protected]>
- Date: Sat, 11 Jul 2015 12:19:10 -0300
- Subject: [PATCH] new row
- ---
- nectar/nectar-vc-addons/nectar-addons.php | 11 +++++++++
- nectar/nectar-vc-addons/vc_templates/vc_row.php | 33 +++++++++++++++++++++++--
- 2 files changed, 42 insertions(+), 2 deletions(-)
- diff --git a/nectar/nectar-vc-addons/nectar-addons.php b/nectar/nectar-vc-addons/nectar-addons.php
- index a4eacf3..2ea78f1 100644
- --- a/nectar/nectar-vc-addons/nectar-addons.php
- +++ b/nectar/nectar-vc-addons/nectar-addons.php
- @@ -88,6 +88,7 @@ vc_remove_param("vc_row", "bg_color");
- vc_remove_param("vc_row", "font_color");
- vc_remove_param("vc_row", "margin_bottom");
- vc_remove_param("vc_row", "bg_image");
- +vc_remove_param("vc_row", "bg_image2");
- vc_remove_param("vc_row", "bg_image_repeat");
- vc_remove_param("vc_row", "padding");
- vc_remove_param("vc_row", "el_class");
- @@ -125,6 +126,16 @@ vc_add_param("vc_row", array(
- ));
- vc_add_param("vc_row", array(
- + "type" => "fws_image",
- + "class" => "",
- + "heading" => "Background Image Above",
- + "param_name" => "bg_image2",
- + "value" => "",
- + "description" => "",
- + "dependency" => Array('element' => "bg_image", 'not_empty' => true)
- +));
- +
- +vc_add_param("vc_row", array(
- "type" => "checkbox",
- "class" => "",
- "heading" => "Background Image Mobile Hidden",
- diff --git a/nectar/nectar-vc-addons/vc_templates/vc_row.php b/nectar/nectar-vc-addons/vc_templates/vc_row.php
- index 767f511..475c99c 100644
- --- a/nectar/nectar-vc-addons/vc_templates/vc_row.php
- +++ b/nectar/nectar-vc-addons/vc_templates/vc_row.php
- @@ -2,7 +2,8 @@
- extract(shortcode_atts(array(
- "type" => 'in_container',
- - 'bg_image'=> '',
- + 'bg_image'=> '',
- + 'bg_image2'=> '',
- 'background_image_mobile_hidden' => '',
- 'bg_position'=> '',
- 'bg_repeat' => '',
- @@ -53,11 +54,13 @@
- $style = null;
- $bg_props = null;
- + $bg_props2 = null;
- $etxra_class = null;
- $using_image_class = null;
- $using_bg_color_class = null;
- $using_custom_text_color = null;
- if($this->shortcode == 'vc_row_inner') $text_color = null;
- + $use_bg2 = !empty($bg_image2) && !empty($bg_image);
- if(!empty($bg_image)) {
- @@ -65,21 +68,41 @@
- $bg_props .= 'background-image: url('. $bg_image . '); ';
- $bg_props .= 'background-position: '. $bg_position .'; ';
- +
- + if ($use_bg2) {
- + $bg_props2 .= 'background-image: url('. $bg_image2 . '); ';
- + $bg_props2 .= 'background-position: '. $bg_position .'; ';
- + }
- } else {
- $bg_image_src = wp_get_attachment_image_src($bg_image, 'full');
- $bg_props .= 'background-image: url('. $bg_image_src[0]. '); ';
- $bg_props .= 'background-position: '. $bg_position .'; ';
- +
- + if ($use_bg2) {
- + $bg_image_src = wp_get_attachment_image_src($bg_image2, 'full');
- +
- + $bg_props2 .= 'background-image: url('. $bg_image_src[0]. '); ';
- + $bg_props2 .= 'background-position: '. $bg_position .'; ';
- + }
- }
- //for pattern bgs
- if(strtolower($bg_repeat) == 'repeat'){
- $bg_props .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
- $etxra_class = 'no-cover';
- +
- + if ($use_bg2) {
- + $bg_props2 .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
- + }
- } else {
- $bg_props .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
- $etxra_class = null;
- +
- + if ($use_bg2) {
- + $bg_props2 .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
- + }
- }
- $using_image_class = 'using-image';
- @@ -142,8 +165,14 @@
- <div id="'.$row_id.'" data-bg-mobile-hidden="'.$background_image_mobile_hidden.'" class="wpb_row vc_row-fluid vc_row '. $main_class . $parallax_class . ' ' . $vertically_center_class . ' '. $class . ' " '.$using_custom_text_color.' style="'.$style.'">';
- //row bg
- - echo '<div class="row-bg-wrap"> <div class="row-bg '.$using_image_class . ' ' . $using_bg_color_class . ' '. $etxra_class.'" style="'.$bg_props.'"></div> </div>';
- + echo '<div class="row-bg-wrap"> <div class="row-bg '.$using_image_class . ' ' . $using_bg_color_class . ' '. $etxra_class.'" style="'.$bg_props.'"></div> ';
- + if ($use_bg2) {
- + echo '<div class="row-bg '.$using_image_class . ' .above '. $etxra_class.'" style="'.$bg_props2.'"></div> ';
- + }
- +
- + echo '</div>';
- +
- //mouse based parallax
- if($mouse_based_parallax_bg == 'true') {
- --
- 1.9.5.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement