Example #1
0
function oxy_shortcode_section($atts, $content = '')
{
    extract(shortcode_atts(array('swatch' => 'swatch-white', 'section_color_set' => '', 'color_speed' => '2000', 'color_duration' => '4000', 'text_shadow' => 'no-shadow', 'inner_shadow' => 'no-shadow', 'width' => 'padded', 'class' => '', 'id' => '', 'label' => '', 'overlay_colour' => '#000000', 'overlay_opacity' => '0', 'overlay_grid' => '0', 'background_video_mp4' => '', 'background_video_webm' => '', 'background_image' => '', 'background_image_size' => 'cover', 'background_image_repeat' => 'no-repeat', 'background_image_attachment' => 'no-scroll', 'background_position_vertical' => '0', 'background_image_parallax' => 'off', 'background_image_parallax_start' => '50', 'background_image_parallax_end' => '60', 'height' => 'normal', 'transparency' => 'opaque', 'vertical_alignment' => 'top'), $atts));
    global $oxy_is_iphone, $oxy_is_ipad, $oxy_is_android;
    $has_video = (!empty($background_video_mp4) || !empty($background_video_webm)) && (!$oxy_is_iphone && !$oxy_is_ipad && !$oxy_is_android || oxy_get_option('mobile_videos') === 'on');
    $has_media = !empty($background_image) || $has_video;
    $section_id = $id == '' ? '' : ' id="' . $id . '"';
    // Fetching the colour sets
    $color_set_attr = array();
    if (!empty($section_color_set)) {
        $colors = array();
        $colors = get_post_meta($section_color_set, THEME_SHORT . '_color_set', true);
        // we need at least one colour to be enabled
        if (!empty($colors)) {
            // set background colour to first colour in the array
            $color_set_attr[] = 'style="background-color:' . $colors[0] . ';"';
            // move first colour to end of array
            $color = array_shift($colors);
            array_push($colors, $color);
            $color_set_attr[] = 'data-color-set="' . implode(',', $colors) . '"';
            $color_set_attr[] = 'data-color-speed="' . $color_speed . '"';
            $color_set_attr[] = 'data-color-duration="' . $color_duration . '"';
        }
    }
    $section_classes = array();
    $section_classes[] = $swatch;
    $section_classes[] = $class;
    $section_classes[] = 'section-text-' . $text_shadow;
    $section_classes[] = 'section-inner-' . $inner_shadow;
    $section_classes[] = 'section-' . $height;
    $section_classes[] = 'section-' . $transparency;
    $background_image_url = '';
    if (is_numeric($background_image)) {
        $attachment_image = wp_get_attachment_image_src($background_image, 'full');
        $background_image_url = $attachment_image[0];
    } else {
        $background_image_url = $background_image;
    }
    $background_media_style = $has_media && !$has_video ? 'background-image: url(\'' . $background_image_url . '\'); background-repeat:' . $background_image_repeat . '; background-size:' . $background_image_size . '; background-attachment:' . $background_image_attachment . '; background-position: 50% ' . $background_position_vertical . '%;' : "";
    // create parallax data attributes if needed
    $parallax_data_attr = array();
    if ('on' === $background_image_parallax) {
        $offset_y = 0;
        if ('navbar-sticky' === oxy_get_option('header_type')) {
            $offset_y = oxy_get_option('navbar_scrolled');
        }
        $parallax_data_attr[] = 'data-start="background-position: 50% ' . $background_image_parallax_start . 'px"';
        $parallax_data_attr[] = 'data-' . $offset_y . '-top-bottom="background-position: 50% ' . $background_image_parallax_end . 'px"';
    }
    $container_class = $width == 'padded' ? 'container' : 'container-fullwidth';
    $row_class = 'vertical-' . $vertical_alignment;
    $overlay_colour = oxy_hex2rgba($overlay_colour, $overlay_opacity);
    ob_start();
    include locate_template('partials/shortcodes/section.php');
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
Example #2
0
 function oxy_shortcode_section($atts, $content = '')
 {
     extract(shortcode_atts(array('text_color' => 'text-normal', 'text_shadow' => 'no-shadow', 'inner_shadow' => 'no-shadow', 'width' => 'padded', 'class' => '', 'id' => '', 'label' => '', 'overlay_colour' => '#000000', 'overlay_opacity' => '0', 'overlay_grid' => '0', 'background_video_mp4' => '', 'background_video_webm' => '', 'background_image' => '', 'background_image_size' => 'cover', 'background_image_repeat' => 'no-repeat', 'background_image_attachment' => 'no-scroll', 'background_position_vertical' => '0', 'background_image_parallax' => 'off', 'background_image_parallax_start' => '0', 'background_image_parallax_end' => '-80', 'height' => 'normal', 'transparency' => 'opaque', 'vertical_alignment' => 'default', 'hidden_on_large' => 'off', 'hidden_on_medium' => 'off', 'hidden_on_small' => 'off', 'hidden_on_xsmall' => 'off'), $atts));
     global $oxy_is_iphone, $oxy_is_ipad, $oxy_is_android;
     $has_video = (!empty($background_video_mp4) || !empty($background_video_webm)) && (!$oxy_is_iphone && !$oxy_is_ipad && !$oxy_is_android || oxy_get_option('mobile_videos') === 'on');
     $has_media = !empty($background_image) || $has_video;
     $section_id = $id == '' ? '' : ' id="' . esc_attr($id) . '"';
     $data_label = $label == '' ? '' : ' data-label="' . esc_attr($label) . '"';
     $section_classes = array();
     $section_classes[] = oxy_add_extra_shortcode_classes($atts);
     $section_classes[] = $text_color;
     $section_classes[] = 'section-text-' . $text_shadow;
     $section_classes[] = 'section-inner-' . $inner_shadow;
     $section_classes[] = 'section-' . $height;
     $section_classes[] = 'section-' . $transparency;
     $background_image_url = '';
     if (is_numeric($background_image)) {
         $attachment_image = wp_get_attachment_image_src($background_image, 'full');
         $background_image_url = $attachment_image[0];
     } else {
         $background_image_url = $background_image;
     }
     $background_media_style = $has_media && !$has_video ? 'background-image: url(\'' . $background_image_url . '\'); background-repeat:' . $background_image_repeat . '; background-size:' . $background_image_size . '; background-attachment:' . $background_image_attachment . '; background-position: 50% ' . $background_position_vertical . '%;' : '';
     // create poster for video if needed
     $video_poster = $has_video && !empty($background_image_url) ? 'poster="' . esc_url($background_image_url) . '" ' : '';
     // create parallax data attributes if needed
     $parallax_data_attr = array();
     if ('on' === $background_image_parallax) {
         $offset_y = 0;
         if ('navbar-sticky' === oxy_get_option('header_type')) {
             $offset_y = oxy_get_option('navbar_scrolled');
         }
         $parallax_data_attr[] = 'data-start="background-position: 50% ' . esc_attr($background_image_parallax_start) . 'px"';
         $parallax_data_attr[] = 'data-' . esc_attr($offset_y) . '-top-bottom="background-position: 50% ' . esc_attr($background_image_parallax_end) . 'px"';
     }
     $container_class = $width == 'padded' ? 'container' : 'container-fullwidth';
     $row_class = 'vertical-' . $vertical_alignment;
     $container_class .= ' container-vertical-' . $vertical_alignment;
     $overlay_colour = oxy_hex2rgba($overlay_colour, $overlay_opacity);
     ob_start();
     include locate_template('partials/shortcodes/section.php');
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
Example #3
0
    ?>
;"><?php 
    echo $per;
    ?>
</p>
            </header>
        </div>
        <?php 
}
?>
        <ul class="pricing-list">
        <?php 
foreach ($list as $item) {
    ?>
            <li style="border-color: <?php 
    echo esc_attr(oxy_hex2rgba($pricing_foreground_colour, 0.1));
    ?>
"><?php 
    echo $item;
    ?>
</li>
        <?php 
}
?>
        </ul>
        <?php 
if ($show_button === 'true') {
    ?>
        <a href="<?php 
    echo $button_link;
    ?>
Example #4
0
    ?>
;"><?php 
    echo $per;
    ?>
</small>
            </h4>
        </div>
        <?php 
}
?>
        <ul class="pricing-list">
        <?php 
foreach ($list as $item) {
    ?>
            <li style="border-color: <?php 
    echo oxy_hex2rgba($pricing_foreground_colour, 0.1);
    ?>
"><?php 
    echo $item;
    ?>
</li>
        <?php 
}
?>
        </ul>
        <?php 
if ($show_button === 'true') {
    ?>
        <a href="<?php 
    echo $button_link;
    ?>