/**
     * Testimonial shortcode
     *
     * @param array $atts
     * @param array $content
     * @return string
     */
    function wolf_shortcode_testimonial($atts, $content = null)
    {
        if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
            $atts = vc_map_get_attributes('wolf_testimonial', $atts);
        }
        extract(shortcode_atts(array('name' => '', 'avatar' => '', 'link' => ''), $atts));
        $cite = '<cite class="testimonial-cite">';
        if ($avatar) {
            $avatar = wolf_get_url_from_attachment_id(absint($avatar), 'avatar');
        }
        if ($name) {
            $cite .= $name;
        }
        if ($link) {
            $link = esc_url($link);
            $cite .= " | <a href='{$link}' target='_blank'>{$link}</a>";
        }
        $cite .= '</cite>';
        $output = "<div class='slide'><div class='testimonal-container'>";
        if ($avatar) {
            $output .= "<span class='testimonial-avatar'><img src='{$avatar}' alt='testimonial-avatar'></span>";
        }
        $output .= "<blockquote class='testimonial-content'>";
        $output .= sanitize_text_field($content);
        $output .= $cite;
        $output .= '</blockquote>';
        $output .= '</div>
		</div>';
        return $output;
    }
 /**
  * Custom Login Logo Option
  *
  * @return int
  */
 function wolf_custom_login_logo()
 {
     $login_logo_id = wolf_get_theme_option('login_logo');
     if ($login_logo_id) {
         echo '<style  type="text/css"> h1 a { background-image:url(' . wolf_get_url_from_attachment_id($login_logo_id, 'avatar') . ' )  !important; } </style>';
     }
 }
예제 #3
0
 /**
  * Get the share image
  *
  * @param int $post_id
  * @return string $share_image
  */
 function wolf_get_meta_share_img($post_id)
 {
     global $post;
     /* We define the default image first and see if the post contains an image after */
     $share_image = wolf_get_theme_option('share_img') ? wolf_get_url_from_attachment_id(absint(wolf_get_theme_option('share_img')), 'large') : null;
     if (has_post_thumbnail($post_id)) {
         $share_image = wolf_get_post_thumbnail_url('large', $post_id);
     }
     return $share_image;
 }
 /**
  * Client Shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_shortcode_clients_carousel_item($atts, $content = null)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_clients_carousel_item', $atts);
     }
     extract(shortcode_atts(array('image' => '', 'link' => '#'), $atts));
     $link = esc_url($link);
     $src = esc_url(wolf_get_url_from_attachment_id(absint($image), 'extra-large'));
     $output = "<div class='block'>";
     $output .= "<a href='{$link}' target='_blank'><img src='{$src}' alt='client-image'></a>";
     $output .= '</div>';
     return $output;
 }
 /**
  * Single Image shortcode
  *
  * @param array $atts
  * @return string
  */
 function wolf_shortcode_linked_image($atts)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_linked_image', $atts);
     }
     extract(shortcode_atts(array('image' => '', 'alignment' => 'center', 'text_alignment' => 'center', 'image_style' => '', 'full_size' => '', 'link' => '', 'text' => '', 'secondary_text' => '', 'overlay_color' => '#000', 'overlay_opacity' => '40', 'text_color' => '#fff', 'text_tag' => 'h3', 'font' => '', 'class' => '', 'image_size' => 'large', 'animation' => '', 'animation_delay' => '', 'inline_style' => '', 'class' => ''), $atts));
     $href = $image_css = '';
     $image_class = $class;
     $image_style = sanitize_text_field($image_style);
     $container_class = "wolf-linked-image text-{$alignment} {$image_style}";
     $overlay_opacity = absint($overlay_opacity) / 100;
     $text = sanitize_text_field($text);
     $link = vc_build_link($link);
     $url = esc_url($link['url']);
     $target = $link['target'];
     $title = $link['title'];
     $secondary_text = sanitize_text_field($secondary_text);
     $secondary_text = "<span class='wolf-linked-image-secondary-text text-{$text_alignment}' style='color:{$text_color}'>{$secondary_text}</span>";
     $text_color = $text_color ? sanitize_text_field($text_color) : '#fff';
     $caption = "<{$text_tag} class='wolf-linked-image-caption text-{$text_alignment}' style='color:{$text_color}'>{$text}</{$text_tag}>";
     if ($inline_style) {
         $image_css .= $inline_style;
     }
     if ('round' == $image_style) {
         $image_size = '2x2';
     }
     $image_css = $inline_style ? " style='{$inline_style}'" : '';
     if ($animation) {
         $container_class .= " wow {$animation}";
     }
     $src = wolf_get_url_from_attachment_id(absint($image), $image_size);
     $src = $src ? $src : wolf_get_theme_uri('/images/placeholders/' . $image_size . '.jpg');
     $output = "<div class='{$container_class}'>";
     if ('http://' != $url && $url) {
         $output .= '<a href="' . esc_url($url) . '" title="' . esc_attr($title) . '" target="' . esc_attr($target) . '" class="image-item">';
     } else {
         $output .= "<span class='image-item'>";
     }
     $output .= "<img src='{$src}' alt='single-image' {$image_css} class='{$image_class}'>";
     $output .= "<span class='wolf-linked-image-overlay' style='opacity:{$overlay_opacity};background-color:{$overlay_color}'></span>";
     $output .= "<span class='wolf-linked-image-caption-container'><span class='wolf-linked-image-caption-table'>\r\n\t\t<span class='wolf-linked-image-caption-table-cell'>\r\n\t\t{$caption}\r\n\t\t{$secondary_text}\r\n\t\t</span>\r\n\t\t</span>\r\n\t\t</span>";
     if ($full_size || 'http://' != $link && $link) {
         $output .= "</a>";
     } else {
         $output .= "</span>";
     }
     $output .= '</div>';
     return $output;
 }
    /**
     * Get the first gallery shortcode, grab the attachments ids and display a slider
     *
     * @param string $size
     */
    function wolf_post_gallery_slider($size = 'slide', $tag_id = null, $class = null, $post_id = null)
    {
        $array_ids = array();
        $post_id = $post_id ? $post_id : get_the_ID();
        $tag_id = $tag_id ? esc_attr($tag_id) : 'post-gallery-slider-' . rand(0, 999);
        $content_post = get_post($post_id);
        $content = $content_post->post_content;
        $pattern = get_shortcode_regex();
        if (preg_match("/{$pattern}/s", $content, $match)) {
            if (isset($match[3]) && preg_match('/\\ ids="(.*)"/', $content, $ids)) {
                if ($ids[1]) {
                    $array_ids = explode(',', $ids[1]);
                }
            }
        }
        ob_start();
        if (array() != $array_ids) {
            ?>
			<div id="<?php 
            echo esc_attr($tag_id);
            ?>
-container">
				<div id="<?php 
            echo esc_attr($tag_id);
            ?>
" class="flexslider post-gallery-slider <?php 
            echo sanitize_html_class($class);
            ?>
 ">
					<ul class="slides">
						<?php 
            foreach ($array_ids as $attachment_id) {
                ?>
						<li class="slide">
							<img src="<?php 
                echo esc_url(wolf_get_url_from_attachment_id($attachment_id, $size));
                ?>
">
						</li>
						<?php 
            }
            ?>
					</ul>
				</div>
			</div>
			<?php 
        }
        return ob_get_clean();
    }
 /**
  * Image Slider shortcode
  *
  * @param array $atts
  * @return string
  */
 function wolf_shortcode_images_slider($atts, $content = null)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_images_slider', $atts);
     }
     extract(shortcode_atts(array('ids' => '', 'layout' => 'default', 'autoplay' => '', 'transition' => 'auto', 'animation' => '', 'animation_delay' => '', 'autoplay' => 'yes', 'transition' => 'auto', 'slideshow_speed' => 4000, 'pause_on_hover' => 'yes', 'nav_bullets' => 'yes', 'nav_arrows' => 'yes', 'inline_style' => '', 'class' => ''), $atts));
     $images = explode(',', $ids);
     $size = 'default' == $layout ? 'slide' : 'slide-' . $layout;
     $style = '';
     $class = $class ? "{$class} " : '';
     // add space
     $class .= "wolf-images-slider-container slider-background-{$layout}";
     if ($animation) {
         $class .= " wow {$animation}";
     }
     if ($animation_delay && 'none' != $animation) {
         $style .= 'animation-delay:' . absint($animation_delay) / 1000 . 's;-webkit-animation-delay:' . absint($animation_delay) / 1000 . 's;';
     }
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     $slider_data = "data-pause-on-hover='{$autoplay}'\r\n\t\tdata-autoplay='{$autoplay}'\r\n\t\tdata-transition='{$transition}'\r\n\t\tdata-slideshow-speed='{$slideshow_speed}'\r\n\t\tdata-nav-arrows='{$nav_arrows}'\r\n\t\tdata-nav-bullets='{$nav_bullets}'";
     $output = '';
     $output .= "<div class='wolf-slider-style-container'{$style}>";
     $output .= "<div class='{$class}'>";
     $output .= "<div {$slider_data} class='flexslider wolf-images-slider'>";
     $output .= '<ul class="slides">';
     foreach ($images as $image_id) {
         $attachment = get_post($image_id);
         $image_url = esc_url(wolf_get_url_from_attachment_id($image_id, $size));
         $full_size = esc_url(wolf_get_url_from_attachment_id($image_id, 'extra-large'));
         $title = $attachment ? wptexturize($attachment->post_title) : '';
         $alt = $attachment ? esc_attr(get_post_meta($attachment->ID, '_wp_attachment_image_alt', true)) : '';
         $alt = $alt ? $alt : $title;
         $post_excerpt = $attachment ? wolf_sample(wptexturize($attachment->post_excerpt), 88) : '';
         $output .= '<li class="slide">';
         $output .= "<img src='{$image_url}' alt='{$alt}'>";
         if ($post_excerpt) {
             $output .= "<p class='flex-caption'>{$post_excerpt}</p>";
         }
         $output .= '</li>';
     }
     $output .= '</ul>';
     $output .= '</div>';
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
 /**
  * Holder Item shortcode
  *
  * @param array $atts
  * @param array $content
  * @return string
  */
 function wolf_shortcode_element_holder_item($atts, $content = null)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_elements_holder_item', $atts);
     }
     extract(shortcode_atts(array('padding' => '', 'background_color' => '', 'background_image' => '', 'font_color' => 'dark', 'type' => 'text', 'inline_style' => '', 'class' => '', 'padding' => ''), $atts));
     $class = $class ? "{$class} " : '';
     // add space
     $class .= "holder-element holder-content-{$type} content-{$font_color}-font";
     $output = '';
     $style = '';
     if ($background_color) {
         $style .= "background-color:{$background_color};";
     }
     if ($background_image) {
         $image = wolf_get_url_from_attachment_id($background_image, 'extra-large');
         $style .= "background:url({$image});";
     }
     if ($padding) {
         $style .= "padding:{$padding};";
     }
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     $output .= "<div class='{$class}'{$style}>";
     $output .= '<div class="holder-element-inner">';
     if ('text' == $type) {
         $output .= '<div class="holder-text-element-inner">';
     }
     $output .= do_shortcode($content);
     if ('text' == $type) {
         $output .= '</div>';
     }
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
예제 #9
0
 /**
  * Output the Logo
  *
  * @access public
  * @return string
  */
 function wolf_logo()
 {
     $logo_dark_id = wolf_get_theme_option('logo_dark');
     $logo_light_id = wolf_get_theme_option('logo_light');
     $logo_sticky_id = wolf_get_theme_option('logo_sticky');
     if ($logo_dark_id || $logo_light_id) {
         $logo_dark = wolf_get_url_from_attachment_id($logo_dark_id, 'full');
         $logo_light = wolf_get_url_from_attachment_id($logo_light_id, 'full');
         $logo_sticky = wolf_get_url_from_attachment_id($logo_sticky_id, 'full');
         $output = '<div class="logo"><a href="' . esc_url(home_url('/')) . '" rel="home">';
         if ($logo_dark_id) {
             $output .= '<img class="logo-dark" src="' . $logo_dark . '" alt="' . esc_attr(get_bloginfo('name')) . '">';
         }
         if ($logo_light_id) {
             $output .= '<img class="logo-light" src="' . $logo_light . '" alt="' . esc_attr(get_bloginfo('name')) . '">';
         }
         //if ( $logo_sticky_id )
         //$output .= '<img id="logo-sticky" src="' . $logo_sticky . '" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '">';
         //elseif( $logo_dark_id )
         //$output .= '<img id="logo-sticky" src="' . $logo_dark . '" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '">';
         $output .= '</a></div>';
         echo wp_kses($output, array('a' => array('href' => array(), 'title' => array(), 'rel' => array()), 'img' => array('src' => array(), 'class' => array(), 'alt' => array()), 'div' => array('class' => array())));
     }
 }
예제 #10
0
        /**
         * Display Inputs
         */
        public function render()
        {
            global $post;
            $post_id = $post->ID;
            $meta_fields = array();
            $current_post_type = get_post_type($post_id);
            foreach ($this->meta as $k => $v) {
                if (is_array($v['page'])) {
                    if (in_array($current_post_type, $v['page'])) {
                        $meta_fields = $v['metafields'];
                    }
                } else {
                    if ($v['page'] == $current_post_type) {
                        $meta_fields = $v['metafields'];
                    }
                }
            }
            // Use nonce for verification
            echo '<input type="hidden" name="custom_meta_box_nonce" value="' . wp_create_nonce(basename(__FILE__)) . '" />';
            // Begin the field table and loop
            echo '<table class="form-table wolf-metabox-table">';
            foreach ($this->meta as $k => $v) {
                if (isset($v['help'])) {
                    echo '<div class="wolf-metabox-help">' . $v['help'] . '</div>';
                }
            }
            foreach ($meta_fields as $field) {
                $field_id = sanitize_title($field['id']);
                $type = isset($field['type']) ? $field['type'] : 'text';
                $label = isset($field['label']) ? $field['label'] : 'Label';
                $desc = isset($field['desc']) ? $field['desc'] : '';
                $def = isset($field['def']) ? $field['def'] : '';
                $dependency = isset($field['dependency']) ? $field['dependency'] : array();
                $class = "option-section-{$field_id}";
                $data = '';
                if (array() != $dependency) {
                    $class .= ' has-dependency';
                    $data .= ' data-dependency-element="' . $dependency['element'] . '"';
                    $dependency_value = '[';
                    foreach ($dependency['value'] as $value) {
                        $dependency_value .= '"' . $value . '"';
                    }
                    $dependency_value .= ']';
                    $data .= " data-dependency-values='{$dependency_value}'";
                }
                // get value of this field if it exists for this post
                $meta = get_post_meta($post_id, $field_id, true);
                if (!$meta) {
                    $meta = $def;
                }
                // begin a table row with
                echo "<tr class='{$class}'{$data}>";
                // debug( $dependency );
                echo "<th style='width:15%'><label for='{$field_id}'>{$label}</label></th>\r\n\r\n\t\t\t\t<td>";
                // editor
                if ('editor' == $type) {
                    wp_editor($meta, $field_id, $settings = array());
                    echo '<br><span class="description">' . $desc . '</span>';
                    // text
                } elseif ('text' == $type || 'int' == $type) {
                    echo '<input type="text" name="' . $field_id . '" id="' . $field_id . '" value="' . $meta . '" size="30" />
						<br><span class="description">' . $desc . '</span>';
                    // textarea
                } elseif ('textarea' == $type) {
                    echo '<textarea name="' . $field_id . '" id="' . $field_id . '" cols="60" rows="4">' . $meta . '</textarea>
						<br><span class="description">' . $desc . '</span>';
                    // checkbox
                } elseif ('checkbox' == $type) {
                    echo '<input type="checkbox" name="' . $field_id . '" id="' . $field_id . '" ', $meta ? ' checked="checked"' : '', '/>
						<span class="description">' . $desc . '</span>';
                    // select
                } elseif ('select' == $type) {
                    echo '<select name="' . $field_id . '" id="' . $field_id . '">';
                    if (array_keys($field['options']) != array_keys(array_keys($field['options']))) {
                        foreach ($field['options'] as $k => $option) {
                            echo '<option', $k == $meta ? ' selected="selected"' : '', ' value="' . $k . '">' . $option . '</option>';
                        }
                    } else {
                        foreach ($field['options'] as $option) {
                            echo '<option', $option == $meta ? ' selected="selected"' : '', ' value="' . $option . '">' . $option . '</option>';
                        }
                    }
                    echo '</select><br><span class="description">' . $desc . '</span>';
                    // colorpicker
                } elseif ('colorpicker' == $type) {
                    echo '<input type="text" class="wolf-options-colorpicker wolf-colorpicker-input" name="' . $field_id . '" id="' . $field_id . '" value="' . $meta . '" />
						<br><span class="description">' . $desc . '</span>';
                    // file
                } elseif ('file' == $type) {
                    $meta_img = get_post_meta($post_id, $field_id, true);
                    ?>
					<div>
						<input type="text"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo esc_url($meta_img);
                    ?>
">
						<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
						<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
					</div>

					<div style="clear:both"></div>
					<?php 
                    // image
                } elseif ('image' == $type) {
                    $meta_img = absint(get_post_meta($post_id, $field_id, true));
                    $meta_img_url = esc_url(wolf_get_url_from_attachment_id($meta_img));
                    ?>
					<div>
						<input type="hidden"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo absint($meta_img);
                    ?>
">
						<img style="max-width:250px;<?php 
                    if (0 == $meta_img) {
                        echo ' display:none;';
                    }
                    ?>
" class="wolf-options-img-preview" src="<?php 
                    echo esc_url($meta_img_url);
                    ?>
" alt="<?php 
                    echo esc_attr($field_id);
                    ?>
">
						<br><a href="#" class="button wolf-options-reset-img"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
						<a href="#" class="button wolf-options-set-img"><?php 
                    _e('Choose an image', 'wolf');
                    ?>
</a>
					</div>

					<div style="clear:both"></div>
					<?php 
                    /*  Background
                    				-------------------------------------------*/
                } elseif ('background' == $type) {
                    $parallax = isset($field['parallax']) ? $field['parallax'] : false;
                    $bg_meta_color = get_post_meta($post_id, $field_id . '_color', true);
                    $bg_meta_repeat = get_post_meta($post_id, $field_id . '_repeat', true);
                    $bg_meta_position = get_post_meta($post_id, $field_id . '_position', true);
                    $bg_meta_attachment = get_post_meta($post_id, $field_id . '_attachment', true);
                    $bg_meta_size = get_post_meta($post_id, $field_id . '_size', true);
                    $bg_meta_parallax = get_post_meta($post_id, $field_id . '_parallax', true);
                    $exclude_params = isset($field['exclude_params']) ? $field['exclude_params'] : array();
                    $img = get_post_meta($post_id, $field_id . '_img', true);
                    if (is_numeric($img)) {
                        $img = absint(get_post_meta($post_id, $field_id . '_img', true));
                        $img_url = wolf_get_url_from_attachment_id($img, 'logo');
                    } else {
                        $img = esc_url(get_post_meta($post_id, $field_id . '_img', true));
                        $img_url = esc_url($img);
                    }
                    /* Bg Image */
                    if (!in_array('color', $exclude_params)) {
                        ?>
						<p><?php 
                        _e('Background color', 'wolf');
                        ?>
</p>
						<input name="<?php 
                        echo esc_attr($field_id . '_color');
                        ?>
" name="<?php 
                        echo esc_attr($field_id . '_color');
                        ?>
" class="wolf-options-colorpicker" type="text" value="<?php 
                        echo esc_attr($bg_meta_color);
                        ?>
">
						<br><br>
						<?php 
                    }
                    if (!in_array('image', $exclude_params)) {
                        ?>
						<p><?php 
                        _e('Background image', 'wolf');
                        ?>
</p>
						<div>
							<input type="hidden" name="<?php 
                        echo esc_attr($field_id);
                        ?>
_img" id="<?php 
                        echo esc_attr($field_id);
                        ?>
_img" value="<?php 
                        echo $img;
                        ?>
">
							<img style="max-width:250px;<?php 
                        if (!$img) {
                            echo ' display:none;';
                        }
                        ?>
" class="wolf-options-img-preview" src="<?php 
                        echo esc_url($img_url);
                        ?>
" alt="<?php 
                        echo esc_attr($field_id);
                        ?>
">
							<br><a href="#" class="button wolf-options-reset-bg"><?php 
                        _e('Clear', 'wolf');
                        ?>
</a>
							<a href="#" class="button wolf-options-set-bg"><?php 
                        _e('Choose an image', 'wolf');
                        ?>
</a>
						</div>
						<br><br>
						<?php 
                    }
                    if (!in_array('repeat', $exclude_params)) {
                        /* Bg Repeat */
                        $options = array('no-repeat', 'repeat', 'repeat-x', 'repeat-y');
                        ?>
						<br>
						<p><?php 
                        _e('Background repeat', 'wolf');
                        ?>
</p>
						<select name="<?php 
                        echo esc_attr($field_id) . '_repeat';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_repeat';
                        ?>
">
							<?php 
                        foreach ($options as $o) {
                            ?>
								<option value="<?php 
                            echo esc_attr($o);
                            ?>
" <?php 
                            if ($o == $bg_meta_repeat) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo esc_attr($o);
                            ?>
</option>
							<?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                    if (!in_array('position', $exclude_params)) {
                        /* Bg position */
                        $options = array('center center', 'center top', 'left top', 'right top', 'center bottom', 'left bottom', 'right bottom', 'left center', 'right center');
                        ?>
						<br><br>
						<p><?php 
                        _e('Background position', 'wolf');
                        ?>
</p>
						<select name="<?php 
                        echo esc_attr($field_id) . '_position';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_position';
                        ?>
">
							<?php 
                        foreach ($options as $o) {
                            ?>
								<option value="<?php 
                            echo esc_attr($o);
                            ?>
" <?php 
                            if ($o == $bg_meta_position) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo esc_attr($o);
                            ?>
</option>
							<?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                    if (!in_array('size', $exclude_params)) {
                        /* size
                        			--------------------*/
                        $options = array('cover' => __('cover (resize)', 'wolf'), 'normal' => __('normal', 'wolf'), 'resize' => __('responsive (hard resize)', 'wolf'));
                        ?>
						<br><br>
						<p><?php 
                        _e('Background size', 'wolf');
                        ?>
</p>
						<select name="<?php 
                        echo esc_attr($field_id) . '_size';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_size';
                        ?>
">
							<?php 
                        foreach ($options as $k => $v) {
                            ?>
								<option value="<?php 
                            echo esc_attr($k);
                            ?>
" <?php 
                            if ($k == $bg_meta_size) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo sanitize_text_field($v);
                            ?>
</option>
							<?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                    if ($parallax) {
                        ?>
							<br><br>
							<p><strong><?php 
                        _e('Parallax', 'wolf');
                        ?>
</strong></p>
							<input <?php 
                        if ($bg_meta_parallax) {
                            echo 'checked="checked"';
                        }
                        ?>
 type="checkbox" name="<?php 
                        echo esc_attr($field_id) . '_parallax';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_parallax';
                        ?>
">
							<?php 
                    }
                    /*  Font
                    				-------------------------------------------*/
                } elseif ('font' == $type) {
                    $color = get_post_meta($post_id, $field_id . '_font_color', true);
                    $name = get_post_meta($post_id, $field_id . '_font_name', true);
                    $weight = get_post_meta($post_id, $field_id . '_font_weight', true);
                    $transform = get_post_meta($post_id, $field_id . '_font_transform', true);
                    $letter_spacing = get_post_meta($post_id, $field_id . '_font_letter_spacing', true);
                    $style = get_post_meta($post_id, $field_id . '_font_style', true);
                    $exclude_params = isset($field['exclude_params']) ? $field['exclude_params'] : array();
                    if (!in_array('color', $exclude_params)) {
                        ?>
						<p><?php 
                        _e('Font color', 'wolf');
                        ?>
</p>
						<input name="<?php 
                        echo esc_attr($field_id) . '_font_color';
                        ?>
" name="<?php 
                        echo $field_id . '_font_color';
                        ?>
" class="wolf-options-colorpicker" type="text" value="<?php 
                        echo esc_attr($color);
                        ?>
">
						<br><br>
						<?php 
                    }
                    if (!in_array('name', $exclude_params)) {
                        global $wolf_fonts;
                        ?>
							<p><?php 
                        _e('Font Family', 'wolf');
                        ?>
</p>
							<select name="<?php 
                        echo esc_attr($field_id) . '_font_name';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_font_name';
                        ?>
">
								<option value=''><?php 
                        _e('default', 'wolf');
                        ?>
</option>
								<?php 
                        foreach ($wolf_fonts as $k => $v) {
                            ?>
									<option value="<?php 
                            echo esc_attr($k);
                            ?>
" <?php 
                            if ($k == $name) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo esc_attr($k);
                            ?>
</option>
								<?php 
                        }
                        ?>
							</select>
						<?php 
                    }
                    if (!in_array('weight', $exclude_params)) {
                        ?>
							<br><br>
							<p><?php 
                        _e('Font weight', 'wolf');
                        ?>
</p>
							<input type="text" name="<?php 
                        echo esc_attr($field_id);
                        ?>
_font_weight" id="<?php 
                        echo esc_attr($field_id);
                        ?>
_font_weight" value="<?php 
                        echo esc_attr($weight);
                        ?>
" >
							<br><span class="description"><?php 
                        _e('For example: 400 is normal, 700 is bold.The available font weights depend on the font.<br>Leave empty to use the theme default style', 'wolf');
                        ?>
</span>
						<?php 
                    }
                    if (!in_array('transform', $exclude_params)) {
                        $options = array('' => __('auto', 'wolf'), 'none' => __('none', 'wolf'), 'uppercase' => __('uppercase', 'wolf'));
                        ?>
							<br><br>
							<p><?php 
                        _e('Font transform', 'wolf');
                        ?>
</p>
							<select name="<?php 
                        echo esc_attr($field_id) . '_font_transform';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_font_transform';
                        ?>
">
								<?php 
                        foreach ($options as $k => $v) {
                            ?>
									<option value="<?php 
                            echo esc_attr($k);
                            ?>
" <?php 
                            if ($k == $transform) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo sanitize_text_field($v);
                            ?>
</option>
								<?php 
                        }
                        ?>
							</select>
							<br><span class="description"><?php 
                        _e('"auto" is the default style in the theme options', 'wolf');
                        ?>
</span>
						<?php 
                    }
                    if (!in_array('style', $exclude_params)) {
                        $options = array('' => __('auto', 'wolf'), 'normal' => __('normal', 'wolf'), 'italic' => __('italic', 'wolf'));
                        ?>
							<br><br>
							<p><?php 
                        _e('Font style', 'wolf');
                        ?>
</p>
							<select name="<?php 
                        echo esc_attr($field_id) . '_font_style';
                        ?>
" id="<?php 
                        echo esc_attr($field_id) . '_font_style';
                        ?>
">
								<?php 
                        foreach ($options as $k => $v) {
                            ?>
									<option value="<?php 
                            echo esc_attr($k);
                            ?>
" <?php 
                            if ($k == $style) {
                                echo 'selected="selected"';
                            }
                            ?>
><?php 
                            echo sanitize_text_field($v);
                            ?>
</option>
								<?php 
                        }
                        ?>
							</select>
							<br><span class="description"><?php 
                        _e('"auto" is the default style defined in the theme options', 'wolf');
                        ?>
</span>
						<?php 
                    }
                    if (!in_array('letter_spacing', $exclude_params)) {
                        ?>
							<br><br>
							<p><?php 
                        _e('Font letter spacing (omit px)', 'wolf');
                        ?>
</p>
							<input type="text" name="<?php 
                        echo esc_attr($field_id);
                        ?>
_font_letter_spacing" id="<?php 
                        echo esc_attr($field_id);
                        ?>
_font_letter_spacing" value="<?php 
                        echo esc_attr($letter_spacing);
                        ?>
">
							<br><span class="description"><?php 
                        _e('Leave empty to use the style defined in the theme options', 'wolf');
                        ?>
</span>
						<?php 
                    }
                    /*  Video
                    				-------------------------------------------*/
                } elseif ('video' == $type) {
                    $mp4 = get_post_meta($post_id, $field_id . '_mp4', true);
                    $webm = get_post_meta($post_id, $field_id . '_webm', true);
                    $ogv = get_post_meta($post_id, $field_id . '_ogv', true);
                    $opacity = get_post_meta($post_id, $field_id . '_opacity', true) ? intval(get_post_meta($post_id, $field_id . '_opacity', true)) : 100;
                    $img = get_post_meta($post_id, $field_id . '_img', true);
                    if (is_numeric($img)) {
                        $img = absint(get_post_meta($post_id, $field_id . '_img', true));
                        $img_url = wolf_get_url_from_attachment_id($img, 'logo');
                    } else {
                        $img = esc_url(get_post_meta($post_id, $field_id . '_img', true));
                        $img_url = esc_url($img);
                    }
                    ?>
						<div>
							<p><strong><?php 
                    _e('mp4 URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
_mp4" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_mp4" value="<?php 
                    echo esc_url($mp4);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
							<p><strong><?php 
                    _e('webm URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
_webm" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_webm" value="<?php 
                    echo esc_url($webm);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
							<p><strong><?php 
                    _e('ogv URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
_ogv" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_ogv" value="<?php 
                    echo esc_url($ogv);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
						<p><strong><?php 
                    _e('Video Image Fallback', 'wolf');
                    ?>
</strong></p>
						<input type="hidden"  name="<?php 
                    echo esc_attr($field_id);
                    ?>
_img" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_img" value="<?php 
                    echo $img;
                    ?>
">
						<img style="max-width:200px;<?php 
                    echo !$img ? 'display:none;' : '';
                    ?>
" src="<?php 
                    echo esc_url($img_url);
                    ?>
" class="wolf-options-img-preview">
						<br><a href="#" class="button wolf-options-reset-img"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
						<a href="#" class="button wolf-options-set-img"><?php 
                    _e('Choose an image', 'wolf');
                    ?>
</a>
						</div>
						<?php 
                }
                //end conditions
                echo '</td></tr>';
            }
            // end foreach
            echo '</table>';
            // end table
        }
예제 #11
0
		<?php 
        } elseif ($hero && wolf_is_slider_in_home_header()) {
            ?>
			<div class="wolf-the-slider-container"><?php 
            echo wolf_format_custom_content_output($hero);
            ?>
</div>
			<?php 
        }
        echo '</div>';
    }
} elseif ('video' == $header_type) {
    if (($video_mp4 || $video_youtube_url) && !wolf_is_slider_in_home_header()) {
        $video_webm = esc_url(wolf_get_theme_option('video_header_bg_webm'));
        $video_ogv = esc_url(wolf_get_theme_option('video_header_bg_ogv'));
        $video_img = esc_url(wolf_get_url_from_attachment_id(wolf_get_theme_option('video_header_bg_img'), 'extra-large'));
        $video_opacity = 100;
        $video_header_bg_color_style = wolf_get_theme_option('video_header_bg_color') ? ' style="background-color:' . wolf_get_theme_option('video_header_bg_color') . '"' : '';
        ?>
		<div class="header-inner">
			<div class="parallax-inner">
				<div class="video-container"<?php 
        echo esc_attr($video_header_bg_color_style);
        ?>
>
					<?php 
        if ($video_mp4 && 'selfhosted' == $video_bg_type) {
            echo wolf_video_bg($video_mp4, $video_webm, $video_ogv, $video_img);
        } elseif ($video_youtube_url && 'youtube' == $video_bg_type) {
            // debug(  $video_img );
            echo wolf_youtube_video_bg($video_youtube_url, $video_img);
예제 #12
0
 /**
  * Columns shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_row_shortcode($atts, $content = null)
 {
     $output = $el_class = $custom_class = $style = '';
     extract(shortcode_atts(array('el_class' => '', 'font_type' => 'dark', 'background_color' => '', 'background_type' => '', 'background_image' => '', 'background_position' => '', 'background_attachment' => '', 'background_repeat' => '', 'background_size' => '', 'video_bg_type' => '', 'video_bg_youtube_url' => '', 'video_bg_mp4' => '', 'video_bg_webm' => '', 'video_bg_ogv' => '', 'video_opacity' => '100', 'video_bg_img' => '', 'content_type' => 'standard', 'no_padding' => '', 'padding_top' => '', 'padding_bottom' => '', 'parallax' => '', 'full_screen' => '', 'anchor' => '', 'overlay' => '', 'overlay_image' => '', 'overlay_color' => '', 'overlay_opacity' => '100', 'inline_style' => '', 'hide_class' => ''), $atts));
     $style = '';
     $overlay_style = '';
     $video_opacity = 100;
     $overlay_opacity = $overlay_opacity ? absint($overlay_opacity) / 100 : 0.4;
     $custom_class .= 'wolf-row clearfix content-' . $font_type . '-font' . ' wolf-row-' . $content_type . '-width';
     if ($hide_class) {
         $custom_class .= ' ' . $hide_class;
     }
     if ($video_bg_mp4 || $video_bg_youtube_url) {
         $custom_class .= ' wolf-row-video-bg';
     }
     if ($no_padding) {
         $custom_class .= ' wolf-row-no-padding';
     }
     if ($full_screen) {
         $custom_class .= ' section-full-screen';
     }
     wp_enqueue_script('wpb_composer_front_js');
     $el_class = $this->getExtraClass($el_class);
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_row section ' . $custom_class . ' ' . get_row_css_class() . $el_class, $this->settings['base']);
     $_image = '';
     if ($background_image != ' ') {
         $_image = wolf_get_url_from_attachment_id($background_image, 'extra-large');
     }
     if ($parallax && 'image' == $background_type && $_image) {
         $css_class .= ' section-parallax';
     }
     if ($background_color) {
         $style .= "background-color:{$background_color};";
     }
     if ('image' == $background_type) {
         if ($background_image) {
             $style .= "background-image:url({$_image});";
         }
         if ($background_position) {
             $style .= "background-position:{$background_position};";
         }
         if ($background_repeat) {
             $style .= "background-repeat:{$background_repeat};";
         }
         if ($background_size == 'cover') {
             $style .= "-webkit-background-size: 100%; -o-background-size: 100%; -moz-background-size: 100%; background-size: 100%;-webkit-background-size: cover; -o-background-size: cover; background-size: cover;";
         }
         if ($background_size == 'resize') {
             $style .= "-webkit-background-size: 100%; -o-background-size: 100%;-moz-background-size: 100%; background-size: 100%;";
         }
     }
     // endif image background
     if ($overlay && ('image' == $background_type && $_image || 'video' == $background_type && ($video_bg_mp4 || $video_bg_youtube_url))) {
         $_overlay_image = '';
         if ($overlay_image != '') {
             $_overlay_image = wolf_get_url_from_attachment_id($overlay_image, 'extra-large');
         }
         if ($overlay_color) {
             $overlay_style .= "background-color:{$overlay_color};";
         }
         if ($overlay_image) {
             $overlay_style .= "background-image:url({$_overlay_image});";
         }
         $overlay_style .= "opacity:{$overlay_opacity};";
     }
     $_style = $style ? ' style="' . wolf_compact_css($style) . '"' : '';
     $_overlay_style = $overlay_style ? ' style="' . wolf_compact_css($overlay_style) . '"' : '';
     $section_id = $anchor ? ' id="' . $anchor . '"' : '';
     $output .= '<div' . $_style . $section_id . ' class="' . $css_class . '">';
     $inner_style = '';
     if ('' != $padding_top) {
         $padding_top = is_numeric($padding_top) ? $padding_top . 'px' : $padding_top;
         $inner_style .= "padding-top:{$padding_top};";
     }
     if ('' != $padding_bottom) {
         $padding_bottom = is_numeric($padding_bottom) ? $padding_bottom . 'px' : $padding_bottom;
         $inner_style .= "padding-bottom:{$padding_bottom};";
     }
     if ($video_bg_mp4 && 'video' == $background_type && 'selhosted' == $video_bg_type) {
         $video_bg_img = $video_bg_img ? wolf_get_url_from_attachment_id(absint($video_bg_img), 'extra-large') : null;
         $output .= wolf_video_bg($video_bg_mp4, $video_bg_webm, $video_bg_ogv, $video_opacity, $video_bg_img, $parallax);
     }
     //elseif( $video_bg_youtube_url && 'video' == $background_type && 'youtube' == $video_bg_type ) {
     $output .= wolf_youtube_video_bg($video_bg_youtube_url);
     //}
     if ($overlay) {
         $output .= '<div class="row-overlay"' . $_overlay_style . '></div>';
     }
     $output .= "<div class='wolf-row-inner' style='{$inner_style}'>";
     $output .= '<div class="wrap">';
     $output .= wpb_js_remove_wpautop($content);
     $output .= '</div><!--.wrap-->';
     $output .= "\n";
     $output .= '</div><!--.wolf-row-inner-->';
     $output .= "\n";
     // end row inner
     $output .= '</div><!--.wolf-row-->';
     return $output;
 }
}
// Exit if accessed directly
$term_list = '';
$post_id = get_the_ID();
$post_type = get_post_type();
if (get_the_terms($post_id, $post_type . '_type')) {
    foreach (get_the_terms($post_id, $post_type . '_type') as $term) {
        $term_list .= $term->slug . ' ';
    }
}
$term_list = $term_list ? substr($term_list, 0, -1) : '';
$format = get_post_format() ? get_post_format() : 'standard';
$views = wolf_format_number(intval(get_post_meta($post_id, '_wolf_views', true)));
$likes = wolf_format_number(intval(get_post_meta($post_id, '_wolf_likes', true)));
$image = wolf_get_post_thumbnail_url('extra-large');
$bg = esc_url(wolf_get_url_from_attachment_id(get_post_thumbnail_id($post_id), 'extra-large'));
$comments = get_comments_number();
$print_term_list = get_the_term_list($post_id, $post_type . '_type', __('in ', 'wolf'), ', ', '');
?>
<article  id="post-<?php 
the_ID();
?>
" <?php 
post_class(array('modern-item', $term_list));
?>
 data-post-id="<?php 
the_ID();
?>
">
	<div class="modern-item-bg" style="background-image:url(<?php 
echo esc_url($bg);
예제 #14
0
 function wolf_custom_gallery($output, $attr)
 {
     global $post, $wp_locale;
     static $instance = 0;
     $instance++;
     // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
     if (isset($attr['orderby'])) {
         $attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
         if (!$attr['orderby']) {
             unset($attr['orderby']);
         }
     }
     extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => ''), $attr));
     $id = intval($id);
     if ('RAND' == $order) {
         $orderby = 'none';
     }
     if (!empty($include)) {
         $include = preg_replace('/[^0-9,]+/', '', $include);
         $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         $attachments = array();
         foreach ($_attachments as $key => $val) {
             $attachments[$val->ID] = $_attachments[$key];
         }
     } elseif (!empty($exclude)) {
         $exclude = preg_replace('/[^0-9,]+/', '', $exclude);
         $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     } else {
         $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     }
     if (empty($attachments)) {
         return '';
     }
     if (is_feed()) {
         $output = "\n";
         foreach ($attachments as $att_id => $attachment) {
             $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
         }
         return $output;
     }
     $itemtag = tag_escape($itemtag);
     $captiontag = tag_escape($captiontag);
     $columns = intval($columns);
     $itemwidth = $columns > 0 ? floor(100 / $columns) : 100;
     $float = is_rtl() ? 'right' : 'left';
     $selector = "gallery-{$instance}";
     $output = apply_filters('gallery_style', "\r\n\t\t\t<style type='text/css'>\r\n\t\t\t\t#{$selector} {\r\n\t\t\t\t\tmargin: auto;\r\n\t\t\t\t}\r\n\t\t\t\t#{$selector} .gallery-item {\r\n\t\t\t\t\tfloat: {$float};\r\n\t\t\t\t\tmargin-top: 10px;\r\n\t\t\t\t\ttext-align: center;\r\n\t\t\t\t\twidth: {$itemwidth}%;\r\n\t\t\t\t}\r\n\t\t\t\t#{$selector} img {\r\n\t\t\t\t\tborder: 2px solid #cfcfcf;\r\n\t\t\t\t}\r\n\t\t\t\t#{$selector} .gallery-caption {\r\n\t\t\t\t\tmargin-left: 0;\r\n\t\t\t\t}\r\n\t\t\t</style>\r\n\t\t\t<!-- see gallery_shortcode() in wp-includes/media.php -->\r\n\t\t\t<div id='{$selector}' class='gallery galleryid-{$id}'>");
     $i = 0;
     foreach ($attachments as $id => $attachment) {
         $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
         $output .= "<{$itemtag} class='gallery-item'>";
         $output .= "\r\n\t\t\t<{$icontag} class='gallery-icon'>\r\n\t\t\t{$link}\r\n\t\t\t</{$icontag}>";
         if ($captiontag && trim($attachment->post_excerpt)) {
             $output .= "\r\n\t\t\t\t<{$captiontag} class='gallery-caption'>\r\n\t\t\t\t" . wptexturize($attachment->post_excerpt) . "\r\n\t\t\t\t</{$captiontag}>";
         }
         $output .= "</{$itemtag}>";
         if ($columns > 0 && ++$i % $columns == 0) {
             $output .= '<br style="clear: both" />';
         }
     }
     $output .= "\r\n\t\t<br style='clear: both;' />\r\n\t\t</div>\n";
     /* Slider output */
     $slider_output = '<div class="wolf-wp-gallery-slider flexslider"><ul class="slides">';
     foreach ($attachments as $id => $attachment) {
         $src = wolf_get_url_from_attachment_id($id, '2x1');
         $slider_output .= '';
         $slider_output .= '<li class="slide">';
         $slider_output .= "<img src='{$src}' alt=''>";
         $slider_output .= '</li>';
     }
     $slider_output .= '</ul></div>';
     /* Masonry gallery output */
     $masonry_output = '<div class="clearfix gallery masonry-gallery"><ul>';
     foreach ($attachments as $id => $attachment) {
         $src = wolf_get_url_from_attachment_id($id, 'masonry');
         $full_src = wolf_get_url_from_attachment_id($id, 'extra-large');
         $masonry_output .= '<li>';
         $masonry_output .= "<a class='lightbox' href='{$full_src}'>";
         $masonry_output .= "<img src='{$src}' alt='gallery-image'>";
         $masonry_output .= '</a>';
         $masonry_output .= '</li>';
     }
     $masonry_output .= '</ul></div>';
     if (wolf_is_blog() || wolf_is_portfolio()) {
         return $slider_output;
     } elseif (is_singular('gallery')) {
         return $masonry_output;
     } else {
         return $output;
     }
 }
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     global $wp_query;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $classes[] = 'menu-item-' . $item->ID;
     if (get_post_meta($item->ID, '_mega-menu', true)) {
         $classes[] = 'mega-menu';
     }
     //if ( get_post_meta( $item->ID, 'mega-menu-cols', true ) )
     //$classes[] = 'mega-menu-cols-' . get_post_meta( $item->ID, 'mega-menu-cols', true );
     if (get_post_meta($item->ID, '_menu-item-not-linked', true)) {
         $classes[] = 'not-linked';
     }
     if (get_post_meta($item->ID, '_menu-item-hidden', true)) {
         $classes[] = 'hidden';
     }
     if (get_post_meta($item->ID, '_menu-item-button-style', true)) {
         $classes[] = 'button-style';
     }
     if (get_post_meta($item->ID, '_menu-item-external', true)) {
         $classes[] = 'external';
     }
     // sub menu skin
     $sub_menu_skin = get_post_meta($item->ID, '_sub-menu-skin', true) ? get_post_meta($item->ID, '_sub-menu-skin', true) : 'sub-menu-dark';
     $classes[] = $sub_menu_skin;
     // background
     $img_id = get_post_meta($item->ID, '_menu-item-background', true);
     $mega_menu_bg = $img_id ? esc_url(wolf_get_url_from_attachment_id(absint($img_id), 'extra-large')) : '';
     $data_bg = $mega_menu_bg ? " data-mega-menu-bg='{$mega_menu_bg}'" : '';
     $bg_repeat = get_post_meta($item->ID, '_menu-item-background-repeat', true);
     $data_bg_repeat = $bg_repeat ? " data-mega-menu-bg-repeat='{$bg_repeat}'" : '';
     // icon position
     $icon_position = get_post_meta($item->ID, '_menu-item-icon-position', true) ? get_post_meta($item->ID, '_menu-item-icon-position', true) : 'before';
     $classes[] = "menu-item-icon-{$icon_position}";
     // var_dump( $classes );
     /**
      * Filter the CSS class(es) applied to a menu item's <li>.
      *
      * @since 3.0.0
      *
      * @see wp_nav_menu()
      *
      * @param array  $classes The CSS classes that are applied to the menu item's <li>.
      * @param object $item    The current menu item.
      * @param array  $args    An array of wp_nav_menu() arguments.
      */
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
     $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
     /**
      * Filter the ID applied to a menu item's <li>.
      *
      * @since 3.0.1
      *
      * @see wp_nav_menu()
      *
      * @param string $menu_id The ID that is applied to the menu item's <li>.
      * @param object $item    The current menu item.
      * @param array  $args    An array of wp_nav_menu() arguments.
      */
     $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
     $id = $id ? ' id="' . esc_attr($id) . '"' : '';
     $output .= $indent . '<li' . $id . $class_names . $data_bg . $data_bg_repeat . '>';
     $atts = array();
     $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
     $atts['target'] = !empty($item->target) ? $item->target : '';
     $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
     $atts['href'] = !empty($item->url) ? $item->url : '';
     /**
      * Filter the HTML attributes applied to a menu item's <a>.
      *
      * @since 3.6.0
      *
      * @see wp_nav_menu()
      *
      * @param array $atts {
      *     The HTML attributes applied to the menu item's <a>, empty strings are ignored.
      *
      *     @type string $title  Title attribute.
      *     @type string $target Target attribute.
      *     @type string $rel    The rel attribute.
      *     @type string $href   The href attribute.
      * }
      * @param object $item The current menu item.
      * @param array  $args An array of wp_nav_menu() arguments.
      */
     $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);
     $attributes = '';
     foreach ($atts as $attr => $value) {
         if (!empty($value)) {
             $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
             $attributes .= ' ' . $attr . '="' . $value . '"';
         }
     }
     if (!is_object($args)) {
         $args = new stdClass();
         $args->before = '';
         $args->link_before = '';
         $args->link_after = '';
         $args->after = '';
     }
     $item_output = $args->before;
     if (get_post_meta($item->ID, '_menu-item-scroll', true)) {
         $item_output .= '<a' . $attributes . ' class="scroll"><span>';
     } else {
         $item_output .= '<a' . $attributes . '><span>';
     }
     /** This filter is documented in wp-includes/post-template.php */
     if (get_post_meta($item->ID, '_menu-item-icon', true) && 'before' == $icon_position) {
         $item_output .= '<i class="fa ' . get_post_meta($item->ID, '_menu-item-icon', true) . '"></i>';
     }
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
     if (get_post_meta($item->ID, '_menu-item-icon', true) && 'after' == $icon_position) {
         $item_output .= '<i class="fa ' . get_post_meta($item->ID, '_menu-item-icon', true) . '"></i>';
     }
     $item_output .= '</span></a>';
     $item_output .= $args->after;
     /**
      * Filter a menu item's starting output.
      *
      * The menu item's starting output only includes $args->before, the opening <a>,
      * the menu item's title, the closing </a>, and $args->after. Currently, there is
      * no filter for modifying the opening and closing <li> for a menu item.
      *
      * @since 3.0.0
      *
      * @see wp_nav_menu()
      *
      * @param string $item_output The menu item's starting HTML output.
      * @param object $item        Menu item data object.
      * @param int    $depth       Depth of menu item. Used for padding.
      * @param array  $args        An array of wp_nav_menu() arguments.
      */
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
예제 #16
0
        /**
         * Generate theme option inputs
         * @return string
         */
        public function do_input($item)
        {
            wp_enqueue_media();
            $prefix = 'wolf_theme_options';
            $type = 'text';
            $size = '';
            $desc = '';
            $def = '';
            $pre = '';
            $app = '';
            $help = '';
            $parallax = false;
            $font_color = true;
            $do_attachment = false;
            $field_id = $item['id'];
            if (isset($item['type'])) {
                $type = $item['type'];
            }
            if (isset($item['size'])) {
                $size = $item['size'];
            }
            if (isset($item['def'])) {
                $def = $item['def'];
            }
            if (isset($item['desc'])) {
                $desc = $item['desc'];
            }
            if (isset($item['pre'])) {
                $pre = $item['pre'];
            }
            if (isset($item['app'])) {
                $app = $item['app'];
            }
            if (isset($item['parallax']) && $item['parallax'] == true && $type == 'background') {
                $parallax = true;
            }
            if (isset($item['font_color']) && $item['font_color'] == false && $type == 'background') {
                $font_color = false;
            }
            if (isset($item['bg_attachment']) && $item['bg_attachment'] == true && $type == 'background') {
                $do_attachment = true;
            }
            if (isset($item['help'])) {
                $help = '<span class="hastip" title="' . __('Click to view the screenshot helper', 'wolf') . '"><a class="wolf-help-img" href="' . esc_url(WOLF_THEME_URI . '/images/admin/help/' . $item['help'] . '.jpg') . '"><img src="' . esc_url(WOLF_FRAMEWORK_URI . '/assets/img/help.png') . '" alt="help"></a></span>';
                if ($type != 'checkbox') {
                    $desc .= $help;
                }
            }
            $dependency = isset($item['dependency']) ? $item['dependency'] : array();
            $class = "option-section-{$field_id}";
            $data = '';
            if (array() != $dependency) {
                $class .= ' has-dependency';
                $data .= ' data-dependency-element="' . $dependency['element'] . '"';
                $value_list = '';
                foreach ($dependency['value'] as $value) {
                    $value_list .= '"' . $value . '",';
                }
                $value_list = rtrim($value_list, ',');
                $dependency_value = "[{$value_list}]";
                $data .= " data-dependency-values='{$dependency_value}'";
            }
            if ($type == 'text' || $type == 'text_html' || $type == 'int' || $type == 'email' || $type == 'url') {
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
						<br>
						<small class="description"><?php 
                echo $desc;
                ?>
</small>
					</label>
				</th>

				<td class="forminp">
					<div class="<?php 
                if ($pre != '') {
                    echo "input-prepend";
                } elseif ($app != '') {
                    echo "input-append";
                }
                ?>
">
					<?php 
                if ($pre != '') {
                    ?>
						<span class="add-on"><?php 
                    echo sanitize_text_field($pre);
                    ?>
</span>
					<?php 
                }
                ?>
						<input<?php 
                echo 'long' == $size ? ' style="max-width:900px;"' : '';
                ?>
 class="option-input" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" type="text" value="<?php 
                echo $this->get_option($field_id) ? htmlentities(stripslashes($this->get_option($field_id))) : $def;
                ?>
">
					<?php 
                if ($app != '') {
                    ?>
						<span class="add-on"><?php 
                    echo sanitize_text_field($app);
                    ?>
</span>
					<?php 
                }
                ?>
					</div>
				</td>
			</tr>


		<?php 
                // to do
            } elseif ($type == 'css') {
                ?>
		<style type="text/css">
		#editor {
			position: absolute;
			width: 500px;
			height: 400px;
		}
		</style>
		<tr valign="top">
	    		<th scope="row" class="titledesc">
				<label for="<?php 
                echo sanitize_text_field($item['label']);
                ?>
"><?php 
                echo sanitize_text_field($item['label']);
                ?>
				<br><small class="description"><?php 
                echo $desc;
                ?>
</small></label>
			</th>

			<td class="forminp">
				<div id="editor"><?php 
                echo sanitize_text_field($this->get_option($field_id));
                ?>
</div>
				<textarea name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="css" style="visibility:hidden;"></textarea>
			</td>
		</tr>
		<script src="<?php 
                echo WOLF_FRAMEWORK_URI;
                ?>
/assets/ace/ace.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php 
                echo WOLF_FRAMEWORK_URI;
                ?>
/assets/ace/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php 
                echo WOLF_FRAMEWORK_URI;
                ?>
/assets/ace/mode-css.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var editor = ace.edit("editor");
			var CssMode = require("ace/mode/css").Mode;
			var textArea = document.getElementById('css');
			document.getElementById('editor').style.fontSize='14px';
			editor.setTheme("ace/theme/twilight");
    			editor.getSession().setMode(new CssMode());
    			editor.getSession().on('change', function( e ) {
				textArea.innerHTML = editor.getValue();
			});
		</script>

		<?php 
            } elseif ($type == 'editor') {
                ?>
		<?php 
                $content = $this->get_option($field_id) ? stripslashes($this->get_option($field_id)) : $def;
                $editor_id = $prefix . '_editor_' . $field_id;
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($editor_id);
                ?>
"><?php 
                echo sanitize_text_field($item['label']);
                ?>
					<br><small class="description"><?php 
                echo $desc;
                ?>
</small></label>
				</th>

				<td class="forminp">
					<div class="wolf-editor-container">
						<?php 
                wp_editor($content, $editor_id, $settings = array());
                ?>
					</div>
				</td>
			</tr>

	    	<?php 
            } elseif ($type == 'textarea' || $type == 'javascript') {
                ?>

		    	<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
<br>
					<small class="description"><?php 
                echo $desc;
                ?>
</small></label>
				</th>

				<td class="forminp">
					<div class="option-textarea">
						<textarea name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo $this->get_option($field_id) ? stripslashes($this->get_option($field_id)) : $def;
                ?>
</textarea>
					</div>
				</td>
			</tr>

	    	<?php 
            } elseif ($type == 'select') {
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
<br>
						<small class="description"><?php 
                echo $desc;
                ?>
</small>
					</label>
				</th>

				<td class="forminp">

					<select name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
">

					<?php 
                if (is_int(key($item['options']))) {
                    // is not associative
                    ?>
						<?php 
                    foreach ($item['options'] as $v) {
                        ?>
							<option value="<?php 
                        echo esc_attr($v);
                        ?>
" <?php 
                        selected(stripslashes($this->get_option($field_id)), $v);
                        ?>
><?php 
                        echo sanitize_text_field($v);
                        ?>
</option>
						<?php 
                    }
                    ?>

					<?php 
                } else {
                    ?>
						<?php 
                    foreach ($item['options'] as $v => $o) {
                        ?>
							<option value="<?php 
                        echo esc_attr($v);
                        ?>
" <?php 
                        selected(stripslashes($this->get_option($field_id)), $v);
                        ?>
><?php 
                        echo sanitize_text_field($o);
                        ?>
</option>
						<?php 
                    }
                    ?>
					<?php 
                }
                ?>
					</select>

				</td>
			</tr>

		<?php 
            } elseif ($type == 'checkbox') {
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
</label>
					<?php 
                echo sanitize_text_field($help);
                ?>
				</th>

				<td class="forminp">
					<input type="checkbox" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" value="true" <?php 
                checked($this->get_option($field_id), 'true');
                ?>
>
					<small class="description"><?php 
                echo $desc;
                ?>
</small>
				</td>
			</tr>

		<?php 
            } elseif ($type == 'radio') {
                ?>

			<div class="wolf_input wolf_checkbox" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
				<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
</label>
				<input type="radio" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" value="true" <?php 
                checked($def, true);
                ?>
>
				<small><?php 
                echo $desc;
                ?>
</small>
			 </div>

		<?php 
            } elseif ($type == 'image') {
                $img = $this->get_option($field_id);
                if (is_numeric($img)) {
                    $img_url = wolf_get_url_from_attachment_id($img, 'logo');
                } else {
                    $img_url = esc_url($img);
                }
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
						<br>
						<small class="description"><?php 
                echo $desc;
                ?>
</small>
					</label>
				</th>

				<td class="forminp">

					<input type="hidden" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" value="<?php 
                echo esc_attr($img);
                ?>
">
					<img <?php 
                if (!$this->get_option($field_id)) {
                    echo 'style="display:none;"';
                }
                ?>
 class="wolf-options-img-preview" src="<?php 
                echo esc_url($img_url);
                ?>
" alt="<?php 
                echo esc_attr($field_id);
                ?>
">
					<br>
					<a href="#" class="button wolf-options-reset-img"><?php 
                _e('Clear', 'wolf');
                ?>
</a>
					<a href="#" class="button wolf-options-set-img"><?php 
                _e('Choose an image', 'wolf');
                ?>
</a>

				</td>
			</tr>

		<?php 
            } elseif ($type == 'file') {
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
<br>
					<small class="description"><?php 
                echo $desc;
                ?>
</small></label>
				</th>

				<td class="forminp">
					<input type="text" class="option-input" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" value="<?php 
                echo esc_url($this->get_option($field_id));
                ?>
">
					<br><br>
					<a href="#" class="button wolf-options-reset-file"><?php 
                _e('Clear', 'wolf');
                ?>
</a>
					<a href="#" class="button wolf-options-set-file"><?php 
                _e('Choose a file', 'wolf');
                ?>
</a>
				</td>
			</tr>

		<?php 
            } elseif ($type == 'background') {
                ?>

		<div class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
			<div class="section-title">
				<h3><?php 
                echo sanitize_text_field($item['label']);
                ?>
</h3>
				<p class="description"><?php 
                echo sanitize_text_field($item['desc']);
                ?>
</p>
			</div>

			<table class="form-table">
				<tbody>

		<?php 
                /* Font Color
                		---------------*/
                ?>
		<?php 
                if ($font_color) {
                    $options = array('dark' => __('Dark', 'wolf'), 'light' => __('Light', 'wolf'));
                    ?>
			 	<tr valign="top">
			    		<th scope="row" class="titledesc">
						<label for="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_font_color]"><?php 
                    _e('Font Color', 'wolf');
                    ?>
</label>
					</th>

					<td class="forminp">
						<select name="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_font_color]" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_font_color">
						<?php 
                    foreach ($options as $o => $v) {
                        ?>
							<option value="<?php 
                        echo esc_attr($o);
                        ?>
" <?php 
                        if (stripslashes($this->get_option($field_id . '_font_color')) == $o) {
                            echo 'selected="selected"';
                        }
                        ?>
><?php 
                        echo sanitize_text_field($v);
                        ?>
</option>
						<?php 
                    }
                    ?>
						</select>
					</td>
				</tr>

			<?php 
                }
                /* Color
                			---------------*/
                ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_color]"><?php 
                _e('Background Color', 'wolf');
                ?>
<br></label>
				</th>

				<td class="forminp">
					<input class="wolf-options-colorpicker" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_color]" id="<?php 
                echo esc_attr($field_id);
                ?>
_color" style="width:75px" type="text" value="<?php 
                if ($this->get_option($field_id . '_color')) {
                    echo htmlentities(stripslashes($this->get_option($field_id . '_color')));
                }
                ?>
">
				</td>
			</tr>

		<?php 
                /* Image
                		---------------*/
                $img = $this->get_option($field_id . '_img');
                if (is_numeric($img)) {
                    $img_url = wolf_get_url_from_attachment_id($img, 'logo');
                } else {
                    $img_url = esc_url($img);
                }
                ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_img]"><?php 
                _e('Background Image', 'wolf');
                ?>
				</label>
				</th>

				<td class="forminp">
					<input type="hidden" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_img]" id="<?php 
                echo esc_attr($field_id);
                ?>
_img" value="<?php 
                echo esc_attr($img);
                ?>
">
					<img <?php 
                if (!$this->get_option($field_id . '_img')) {
                    echo 'style="display:none;"';
                }
                ?>
 class="wolf-options-img-preview" src="<?php 
                echo esc_url($img_url);
                ?>
" alt="<?php 
                echo esc_attr($field_id);
                ?>
">
					<br><a href="#" class="button wolf-options-reset-bg"><?php 
                _e('Clear', 'wolf');
                ?>
</a>
					<a href="#" class="button wolf-options-set-bg"><?php 
                _e('Choose an image', 'wolf');
                ?>
</a>
				</td>
			</tr>

		<?php 
                /* Repeat
                		---------------*/
                ?>
		<?php 
                $options = array('no-repeat', 'repeat', 'repeat-x', 'repeat-y');
                ?>
		 	<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_repeat]"><?php 
                _e('Repeat', 'wolf');
                ?>
</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_repeat]" id="<?php 
                echo esc_attr($field_id);
                ?>
_repeat">
					<?php 
                foreach ($options as $o) {
                    ?>
						<option value="<?php 
                    echo esc_attr($o);
                    ?>
" <?php 
                    if (stripslashes($this->get_option($field_id . '_repeat')) == $o) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo sanitize_text_field($o);
                    ?>
</option>
					<?php 
                }
                ?>
					</select>
				</td>
			</tr>

		<?php 
                /* Position
                		---------------*/
                $options = array('center center', 'center top', 'left top', 'right top', 'center bottom', 'left bottom', 'right bottom', 'left center', 'right center');
                ?>
	 		<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_position]"><?php 
                _e('Position', 'wolf');
                ?>
</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_position]" id="<?php 
                echo esc_attr($field_id);
                ?>
_position">
					<?php 
                foreach ($options as $o) {
                    ?>
						<option value="<?php 
                    echo esc_attr($o);
                    ?>
" <?php 
                    selected($this->get_option($field_id . '_position'), $o);
                    ?>
><?php 
                    echo sanitize_text_field($o);
                    ?>
</option>
					<?php 
                }
                ?>
					</select>
				</td>
			</tr>
		<?php 
                if ($do_attachment) {
                    /* Attachment
                    			---------------*/
                    $options = array('scroll', 'fixed');
                    ?>
		 		<tr valign="top">
			    		<th scope="row" class="titledesc">
						<label for="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_attachment]"><?php 
                    _e('Attachment', 'wolf');
                    ?>
</label>
					</th>

					<td class="forminp">
						<select name="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_attachment]" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_attachment">
						<?php 
                    foreach ($options as $o) {
                        ?>
							<option value="<?php 
                        echo esc_attr($o);
                        ?>
" <?php 
                        selected($this->get_option($field_id . '_attachment'), $o);
                        ?>
><?php 
                        echo sanitize_text_field($o);
                        ?>
</option>
						<?php 
                    }
                    ?>
						</select>
					</td>
				</tr>
			<?php 
                }
                // endif attachment
                /* Size
                		---------------*/
                $options = array('cover' => __('cover (resize)', 'wolf'), 'normal' => __('normal', 'wolf'), 'resize' => __('responsive (hard resize)', 'wolf'));
                ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_size]"><?php 
                _e('Size', 'wolf');
                ?>
</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
_size]" id="<?php 
                echo esc_attr($field_id);
                ?>
_size">
					<?php 
                foreach ($options as $o => $v) {
                    ?>
						<option value="<?php 
                    echo esc_attr($o);
                    ?>
" <?php 
                    selected($this->get_option($field_id . '_size'), $o);
                    ?>
><?php 
                    echo sanitize_text_field($v);
                    ?>
</option>
					<?php 
                }
                ?>
					</select>
				</td>
			</tr>

				<?php 
                if ($parallax) {
                    ?>
					<tr valign="top">
				    		<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_parallax]"><?php 
                    _e('Parallax', 'wolf');
                    ?>
</label>
							</label>
						</th>

						<td class="forminp">
							<input type="checkbox" name="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_parallax]" id="<?php 
                    echo esc_attr($field_id);
                    ?>
_parallax" value="true" <?php 
                    checked($this->get_option($field_id . '_parallax'), 'true');
                    ?>
>
						</td>
					</tr>

				<?php 
                }
                ?>
			</tbody>
		</table>

		</div><!-- end option section -->
		<?php 
                /* Font
                		---------------*/
            } elseif ($type == 'font') {
                $field_id = $field_id;
                $color = $this->get_option($field_id . '_font_color');
                $name = $this->get_option($field_id . '_font_name');
                $weight = $this->get_option($field_id . '_font_weight');
                $transform = $this->get_option($field_id . '_font_transform');
                $letter_spacing = $this->get_option($field_id . '_font_letter_spacing');
                $style = $this->get_option($field_id . '_font_style');
                $exclude_params = isset($item['exclude_params']) ? $item['exclude_params'] : array();
                ?>
		<div class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
			<div class="section-title">
				<h3><?php 
                echo sanitize_text_field($item['label']);
                ?>
</h3>
				<p class="description"><?php 
                echo sanitize_text_field($item['desc']);
                ?>
</p>
			</div>

			<table class="form-table">
				<tbody>

			<?php 
                if (!in_array('name', $exclude_params)) {
                    global $wolf_fonts;
                    // debug( $wolf_fonts );
                    ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_name]';
                    ?>
"><?php 
                    _e('Font family', 'wolf');
                    ?>
<br>
					</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_name]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
						<?php 
                    foreach ($wolf_fonts as $k => $v) {
                        ?>
							<option value="<?php 
                        echo esc_attr($k);
                        ?>
" <?php 
                        selected($k, $name);
                        ?>
><?php 
                        echo sanitize_text_field($k);
                        ?>
</option>
						<?php 
                    }
                    ?>
					</select>
				</td>
			</tr>
			<?php 
                }
                if (!in_array('color', $exclude_params)) {
                    ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_color]';
                    ?>
"><?php 
                    _e('Font color', 'wolf');
                    ?>
<br>
					</label>
				</th>

				<td class="forminp">
					<input class="wolf-options-colorpicker" value="<?php 
                    echo esc_attr($color);
                    ?>
" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_color]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
				</td>
			</tr>
			<?php 
                }
                if (!in_array('weight', $exclude_params)) {
                    ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_weight]';
                    ?>
"><?php 
                    _e('Font weight', 'wolf');
                    ?>
<br>
					<small class="description"><?php 
                    _e('For example: 400 is normal, 700 is bold.The available font weights depend on the font. Leave empty to use the theme default style', 'wolf');
                    ?>
</small>
					</label>
				</th>

				<td class="forminp">
					<input value="<?php 
                    echo esc_attr($weight);
                    ?>
" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_weight]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
				</td>
			</tr>
			<?php 
                }
                if (!in_array('transform', $exclude_params)) {
                    $options = array('none', 'uppercase');
                    ?>
			<tr valign="top">
		    		<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_transform]';
                    ?>
"><?php 
                    _e('Font transform', 'wolf');
                    ?>
<br>
					</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_transform]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
						<?php 
                    foreach ($options as $o) {
                        ?>
							<option value="<?php 
                        echo esc_attr($o);
                        ?>
" <?php 
                        if ($o == $transform) {
                            echo 'selected="selected"';
                        }
                        ?>
><?php 
                        echo sanitize_text_field($o);
                        ?>
</option>
						<?php 
                    }
                    ?>
					</select>
				</td>
			</tr>
			<?php 
                }
                if (!in_array('style', $exclude_params)) {
                    $options = array('normal', 'italic');
                    ?>
			<tr valign="top">
				<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_style]';
                    ?>
"><?php 
                    _e('Font style', 'wolf');
                    ?>
<br>
					</label>
				</th>

				<td class="forminp">
					<select name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_style]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
						<?php 
                    foreach ($options as $o) {
                        ?>
							<option value="<?php 
                        echo esc_attr($o);
                        ?>
" <?php 
                        selected($o, $style);
                        ?>
><?php 
                        echo sanitize_text_field($o);
                        ?>
</option>
						<?php 
                    }
                    ?>
					</select>
				</td>
			</tr>
			<?php 
                }
                if (!in_array('letter_spacing', $exclude_params)) {
                    ?>
			<tr valign="top">
				<th scope="row" class="titledesc">
					<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_font_letter_spacing]';
                    ?>
"><?php 
                    _e('Letter Spacing (omit px)', 'wolf');
                    ?>
<br>
					</label>
				</th>

				<td class="forminp">
					<input value="<?php 
                    echo esc_attr($letter_spacing);
                    ?>
" name="<?php 
                    echo esc_attr($prefix . '[' . $field_id . '_font_letter_spacing]');
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
">
				</td>
			</tr>
			<?php 
                }
                ?>
			</tbody>
		</table>
		</div><!-- end option section -->
		<?php 
                /* video
                		---------------*/
            } elseif ($type == 'video') {
                $type = $this->get_option($field_id . '_type');
                $youtube_url = $this->get_option($field_id . '_youtube_url');
                $mp4 = $this->get_option($field_id . '_mp4');
                $webm = $this->get_option($field_id . '_webm');
                $ogv = $this->get_option($field_id . '_ogg');
                $opacity = $this->get_option($field_id . '_opacity') ? intval($this->get_option($field_id . '_opacity')) : 100;
                $img = $this->get_option($field_id . '_img');
                $exclude_params = isset($item['exclude_params']) ? $item['exclude_params'] : array();
                ?>
		<div class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
			<div class="section-title">
				<h3><?php 
                echo sanitize_text_field($item['label']);
                ?>
</h3>
				<p class="description"><?php 
                echo sanitize_text_field($item['desc']);
                ?>
</p>
			</div>

			<table class="form-table">
				<tbody>

				<?php 
                if (!in_array('type', $exclude_params)) {
                    ?>
					<tr valign="top" class="option-section-<?php 
                    echo esc_attr($field_id . '_type');
                    ?>
">
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_type]';
                    ?>
"><?php 
                    _e('Video Background type', 'wolf');
                    ?>
<br>
						</th>

						<td class="forminp">
							<select name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_type]';
                    ?>
">
								<option value="youtube" <?php 
                    selected($type, 'youtube');
                    ?>
>Youtube</option>
								<option value="selfhosted" <?php 
                    selected($type, 'selfhosted');
                    ?>
><?php 
                    _e('Self hosted', 'wolf');
                    ?>
</option>
							</select>
						</td>
					</tr>
				<?php 
                }
                ?>

				<?php 
                if (!in_array('youtube_url', $exclude_params)) {
                    ?>
					<tr valign="top" class="has-dependency" data-dependency-element="<?php 
                    echo esc_attr($field_id . '_type');
                    ?>
" data-dependency-values='["youtube"]'>
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_youtube_url]';
                    ?>
"><?php 
                    _e('Video Background Youtube URL', 'wolf');
                    ?>
<br>
						</th>

						<td class="forminp">
							<input class="option-input" name="<?php 
                    echo esc_attr($prefix);
                    ?>
[<?php 
                    echo esc_attr($field_id);
                    ?>
_youtube_url]" type="text" value="<?php 
                    echo esc_url($youtube_url);
                    ?>
">
						</td>
					</tr>
				<?php 
                }
                ?>

				<?php 
                if (!in_array('mp4', $exclude_params)) {
                    ?>
					<tr valign="top" class="has-dependency" data-dependency-element="<?php 
                    echo esc_attr($field_id . '_type');
                    ?>
" data-dependency-values='["selfhosted"]'>
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_mp4]';
                    ?>
"><?php 
                    _e('mp4 URL', 'wolf');
                    ?>
<br>
						</th>

						<td class="forminp">
							<input type="text" class="option-input" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_mp4]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo esc_url($mp4);
                    ?>
">
							<br><br>
							<a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
						</td>
					</tr>
				<?php 
                }
                ?>

				<?php 
                if (!in_array('webm', $exclude_params)) {
                    ?>
					<tr valign="top" class="has-dependency" data-dependency-element="<?php 
                    echo esc_attr($field_id . '_type');
                    ?>
" data-dependency-values='["selfhosted"]'>
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_webm]';
                    ?>
"><?php 
                    _e('webm URL', 'wolf');
                    ?>
<br>
						</th>

						<td class="forminp">
							<input type="text" class="option-input" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_webm]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo esc_url($webm);
                    ?>
">
							<br><br>
							<a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
						</td>
					</tr>
				<?php 
                }
                ?>

				<?php 
                if (!in_array('ogv', $exclude_params)) {
                    ?>
					<tr valign="top" class="has-dependency" data-dependency-element="<?php 
                    echo esc_attr($field_id . '_type');
                    ?>
" data-dependency-values='["selfhosted"]'>
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_ogv]';
                    ?>
"><?php 
                    _e('ogv URL', 'wolf');
                    ?>
<br>
						</th>

						<td class="forminp">
							<input type="text" class="option-input" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_ogv]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo esc_url($ogv);
                    ?>
">
							<br><br>
							<a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
						</td>
					</tr>
				<?php 
                }
                ?>

				<?php 
                if (!in_array('image', $exclude_params)) {
                    ?>
					<tr valign="top">
						<th scope="row" class="titledesc">
							<label for="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_img]';
                    ?>
"><?php 
                    _e('Image URL', 'wolf');
                    ?>
<br>
							<small class="description"><?php 
                    _e('Image fallback', 'wolf');
                    ?>
</small></label>
						</th>

						<td class="forminp">
							<input type="text" class="option-input" name="<?php 
                    echo esc_attr($prefix) . '[' . $field_id . '_img]';
                    ?>
" id="<?php 
                    echo esc_attr($field_id);
                    ?>
" value="<?php 
                    echo esc_url($img);
                    ?>
">
							<br><br>
							<a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
						</td>
					</tr>
				<?php 
                }
                ?>

			</tbody>
		</table>

		</div><!-- end option section -->
		<?php 
            } elseif ($type == 'colorpicker') {
                ?>

			<tr valign="top" class="<?php 
                echo esc_attr($class);
                ?>
"<?php 
                echo $data;
                ?>
>
				<th scope="row" class="titledesc">
					<label for="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]"><?php 
                echo sanitize_text_field($item['label']);
                ?>
<br>
						<small class="description"><?php 
                echo $desc;
                ?>
</small>
					</label>
				</th>

				<td class="forminp">
					<input class="wolf-options-colorpicker" name="<?php 
                echo esc_attr($prefix);
                ?>
[<?php 
                echo esc_attr($field_id);
                ?>
]" id="<?php 
                echo esc_attr($field_id);
                ?>
" type="text" value="<?php 
                echo $this->get_option($field_id) ? htmlentities(stripslashes($this->get_option($field_id))) : $def;
                ?>
">
				</td>
			</tr>


		<?php 
            }
        }
 /**
  * Check the resolution of the video thumbnail
  *
  * @access public
  * @param int post_id
  * @return bool
  */
 function wolf_has_high_res_thumbnail($size = '', $wanted_width = 640, $wanted_height = 360, $post_id = null)
 {
     if (!$post_id) {
         $post_id = get_the_ID();
     }
     $attachment_id = get_post_thumbnail_id($post_id);
     $image = wolf_get_url_from_attachment_id($attachment_id, $size);
     $image = str_replace(esc_url(home_url()) . '/', ABSPATH, $image);
     //debug( $image );
     if (is_file($image)) {
         list($width, $height) = getimagesize($image);
         //debug( getimagesize( $image ) );
         if ($wanted_width == $width && $wanted_height == $height) {
             return true;
         }
     }
 }
    /**
     * Print field
     *
     * @param object $item  Menu item data object.
     * @param int    $depth  Depth of menu item. Used for padding.
     * @param array  $args  Menu item args.
     * @param int    $id    Nav menu ID.
     *
     * @return string Form fields
     */
    public static function _fields($item, $depth, $args = array(), $id = 0)
    {
        $item_id = $item->ID;
        global $icons;
        ?>
			<p>&nbsp;</p>
			<p class="field-_sub-menu-skin description description-wide">
				<label for="edit-_sub-menu-skin-<?php 
        echo esc_attr($item_id);
        ?>
"><?php 
        _e('Sub menu skin (only for first level item)', 'wolf');
        ?>
</label>
					<br>
					<select name="_sub-menu-skin[<?php 
        echo esc_attr($item_id);
        ?>
]">
						<option value="sub-menu-dark" <?php 
        selected(get_post_meta($item_id, '_sub-menu-skin', true), 'sub-menu-dark');
        ?>
><?php 
        _e('dark', 'wolf');
        ?>
</option>
						<option value="sub-menu-light" <?php 
        selected(get_post_meta($item_id, '_sub-menu-skin', true), 'sub-menu-light');
        ?>
><?php 
        _e('light', 'wolf');
        ?>
</option>
					</select>
			</p>
			<p class="field-_mega-menu description description-wide">
				<label for="edit-_mega-menu-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_mega-menu[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_mega-menu', true), 'on');
        ?>
>
					<?php 
        _e('Mega Menu (only available for first level items)', 'wolf');
        ?>
				</label>
			</p>

			<p class="field-_menu-item-not-linked description description-wide">
				<label for="edit-_menu-item-not-linked-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_menu-item-not-linked[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_menu-item-not-linked', true), 'on');
        ?>
>
					<?php 
        _e('Mega Menu 2nd level or dropdown item', 'wolf');
        ?>
				</label>
			</p>

			<p class="field-_menu-item-hidden description description-wide">
				<label for="edit-_menu-item-hidden-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_menu-item-hidden[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_menu-item-hidden', true), 'on');
        ?>
>
					<?php 
        _e('Hide item on mega menu (for mega menu 2nd level only)', 'wolf');
        ?>
				</label>
			</p>

			<p class="field-_menu-item-button-style description description-wide">
				<label for="edit-_menu-item-button-style-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_menu-item-button-style[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_menu-item-button-style', true), 'on');
        ?>
>
					<?php 
        _e('Button Style (only available for first level items)', 'wolf');
        ?>
				</label>
			</p>

			<p class="field-_menu-item-scroll description description-wide">
				<label for="edit-_menu-item-scroll-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_menu-item-scroll[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_menu-item-scroll', true), 'on');
        ?>
>
					<?php 
        _e('Scroll to an anchor', 'wolf');
        ?>
				</label>
			</p>
			<p class="field-_menu-item-external description description-wide">
				<label for="edit-_menu-item-external-<?php 
        echo esc_attr($item_id);
        ?>
">
					<input name="_menu-item-external[<?php 
        echo esc_attr($item_id);
        ?>
]" value="on" type="checkbox" <?php 
        checked(get_post_meta($item_id, '_menu-item-external', true), 'on');
        ?>
>
					<?php 
        _e('External link?', 'wolf');
        ?>
				</label>
			</p>
			<p class="field-background description description-wide">
				<?php 
        $img_id = absint(get_post_meta($item_id, '_menu-item-background', true));
        $img_url = wolf_get_url_from_attachment_id($img_id);
        ?>
				<label for="edit-_menu-item-background-<?php 
        echo esc_attr($item_id);
        ?>
">
					<?php 
        _e('Background Image (only for 1rst level mega menu)', 'wolf');
        ?>
					<input type="hidden" name="_menu-item-background[<?php 
        echo esc_attr($item_id);
        ?>
]" id="_menu-item-background[<?php 
        echo esc_attr($item_id);
        ?>
]" value="<?php 
        echo absint($img_id);
        ?>
">
					<img <?php 
        if (!get_post_meta($item_id, '_menu-item-background', true)) {
            echo 'style="display:none;"';
        }
        ?>
 class="wolf-options-img-preview" src="<?php 
        echo esc_url($img_url);
        ?>
" alt="menu-bg">
					<br>
					<a href="#" class="button wolf-options-reset-img"><?php 
        _e('Clear', 'wolf');
        ?>
</a>
					<a href="#" class="button wolf-options-set-img"><?php 
        _e('Choose an image', 'wolf');
        ?>
</a>
				</label>
			</p>
			<p class="field-_menu-item-background-repeat description description-wide">
				<label for="edit-_menu-item-background-repeat-<?php 
        echo esc_attr($item_id);
        ?>
"><?php 
        _e('Background repeat', 'wolf');
        ?>
</label><br>
					<select name="_menu-item-background-repeat[<?php 
        echo esc_attr($item_id);
        ?>
]">
						<option value="no-repeat" <?php 
        selected(get_post_meta($item_id, '_menu-item-background-repeat', true), 'no-repeat');
        ?>
><?php 
        _e('no repeat', 'wolf');
        ?>
</option>
						<option value="repeat" <?php 
        selected(get_post_meta($item_id, '_menu-item-background-repeat', true), 'repeat');
        ?>
><?php 
        _e('repeat', 'wolf');
        ?>
</option>
					</select>
			</p>
			<p class="field-custom description description-wide wolf-searchable-container">
				<label for="edit-_menu-item-icon-<?php 
        echo esc_attr($item_id);
        ?>
"><?php 
        _e('Icon', 'wolf');
        ?>
</label><br />
					<span style="font-style:normal;"><?php 
        printf('<select data-placeholder="%1$s" name="_menu-item-icon[%2$d]" class="wolf-searchable edit-_menu-item-icon" id="edit-_menu-item-icon-%2$d">', __('None', 'wolf'), $item_id);
        echo '<option value="">' . __('None', 'wolf') . '</option>';
        // esc_attr( get_post_meta( $item_id, '_menu-item-icon', true ) )
        foreach ($icons as $key => $value) {
            echo '<option value="' . esc_attr($key) . '"';
            selected(esc_attr(get_post_meta($item_id, '_menu-item-icon', true)), $key);
            echo ">{$value}</option>";
        }
        echo '</select>';
        ?>
</span>
			</p>

			<p class="field-_menu-item-icon-position description description-wide">
				<label for="edit-_menu-item-icon-position-<?php 
        echo esc_attr($item_id);
        ?>
"><?php 
        _e('Icon position', 'wolf');
        ?>
</label>
					<br>
					<select name="_menu-item-icon-position[<?php 
        echo esc_attr($item_id);
        ?>
]">
						<option value="before" <?php 
        selected(get_post_meta($item_id, '_menu-item-icon-position', true), 'before');
        ?>
><?php 
        _e('before', 'wolf');
        ?>
</option>
						<option value="after" <?php 
        selected(get_post_meta($item_id, '_menu-item-icon-position', true), 'after');
        ?>
><?php 
        _e('after', 'wolf');
        ?>
</option>
					</select>
			</p>
		<?php 
    }
예제 #19
0
$_style = $style ? ' style="' . wolf_compact_css($style) . '"' : '';
$_overlay_style = $overlay_style ? ' style="' . wolf_compact_css($overlay_style) . '"' : '';
$section_id = $anchor ? ' id="' . $anchor . '"' : '';
$output .= '<div' . $_style . $section_id . ' class="' . $css_class . '">';
$inner_style = '';
if ('' != $padding_top) {
    $padding_top = is_numeric($padding_top) ? $padding_top . 'px' : $padding_top;
    $inner_style .= "padding-top:{$padding_top};";
}
if ('' != $padding_bottom) {
    $padding_bottom = is_numeric($padding_bottom) ? $padding_bottom . 'px' : $padding_bottom;
    $inner_style .= "padding-bottom:{$padding_bottom};";
}
// video background
if ('video' == $background_type) {
    $video_bg_img = $video_bg_img ? wolf_get_url_from_attachment_id(absint($video_bg_img), 'extra-large') : null;
    if ($video_bg_mp4 && 'selfhosted' == $video_bg_type) {
        $output .= wolf_video_bg($video_bg_mp4, $video_bg_webm, $video_bg_ogv, $video_bg_img, $parallax);
    } elseif ($video_bg_youtube_url && 'youtube' == $video_bg_type) {
        $output .= wolf_youtube_video_bg($video_bg_youtube_url, $video_bg_img);
    }
}
if ($overlay) {
    $output .= '<div class="row-overlay"' . $_overlay_style . '></div>';
}
$output .= "<div class='wolf-row-inner' style='{$inner_style}'>";
$output .= '<div class="wrap">';
$output .= wpb_js_remove_wpautop($content);
$output .= '</div><!--.wrap-->';
$output .= "\n";
$output .= '</div><!--.wolf-row-inner-->';
예제 #20
0
    /**
     * Output loader overlay
     *
     * @access public
     * @since 1.0.0
     * @return void
     */
    function wolf_page_loader()
    {
        if (wolf_get_theme_option('page_transition')) {
            $loader = wolf_get_theme_option('loader_type');
            ?>
		<div id="loading-overlay"><div id="loader">
			<?php 
            if (wolf_get_theme_option('loading_logo')) {
                ?>
				<img id="loading-logo" src="<?php 
                echo esc_url(wolf_get_url_from_attachment_id(wolf_get_theme_option('loading_logo'), 'logo'));
                ?>
" alt="loading-logo">
			<?php 
            }
            ?>
			<?php 
            if (wolf_get_theme_option('loader')) {
                ?>
				<?php 
                if ('loader1' == $loader) {
                    ?>
					<div class="loader1"></div>
				<?php 
                } elseif ('loader2' == $loader) {
                    ?>
					<div class="loader2">
						<div class="loader2-double-bounce1"></div>
						<div class="loader2-double-bounce2"></div>
					</div>
				<?php 
                } elseif ('loader3' == $loader) {
                    ?>
					<div class="loader3">
						<div class="loader3-rect1"></div>
						<div class="loader3-rect2"></div>
						<div class="loader3-rect3"></div>
						<div class="loader3-rect4"></div>
						<div class="loader3-rect5"></div>
					</div>
				<?php 
                } elseif ('loader4' == $loader) {
                    ?>
					<div class="loader4">
						<div class="loader4-cube1"></div>
						<div class="loader4-cube2"></div>
					</div>
				<?php 
                } elseif ('loader5' == $loader) {
                    ?>
					<!-- <div class="loader5"></div> -->
					<div class="loading">
					  <div class="loading-bar"></div>
					  <div class="loading-bar"></div>
					  <div class="loading-bar"></div>
					  <div class="loading-bar"></div>
					</div>
				<?php 
                } elseif ('loader6' == $loader) {
                    ?>
					<div class="loader6">
						<div class="loader6-dot1"></div>
						<div class="loader6-dot2"></div>
					</div>
				<?php 
                } elseif ('loader7' == $loader) {
                    ?>
					<div class="loader7">
						<div class="loader7-bounce1"></div>
						<div class="loader7-bounce2"></div>
						<div class="loader7-bounce3"></div>
					</div>
				<?php 
                } elseif ('loader8' == $loader) {
                    ?>
					<div class="loader8">
						<div class="loader8-container loader8-container1">
							<div class="loader8-circle1"></div>
							<div class="loader8-circle2"></div>
							<div class="loader8-circle3"></div>
							<div class="loader8-circle4"></div>
						</div>
						<div class="loader8-container loader8-container2">
							<div class="loader8-circle1"></div>
							<div class="loader8-circle2"></div>
							<div class="loader8-circle3"></div>
							<div class="loader8-circle4"></div>
						</div>
						<div class="loader8-container loader8-container3">
							<div class="loader8-circle1"></div>
							<div class="loader8-circle2"></div>
							<div class="loader8-circle3"></div>
							<div class="loader8-circle4"></div>
						</div>
					</div>
				<?php 
                }
                ?>
			<?php 
            }
            ?>
			</div></div>
		<?php 
        }
    }
 /**
  * Generate a mosaic carouel layout gallery
  *
  * @access public
  * @param array $images
  * @param string $link
  * @param string $hover_effect
  * @param string $orderby
  * @param bool $carousel
  * @return string $output
  */
 function wolf_mosaic_gallery($images = array(), $link = 'file', $hover_effect = 'default', $orderby = '', $carousel = true, $inline_style = '', $class = '')
 {
     if ('rand' == $orderby) {
         shuffle($images);
     }
     $rand_id = rand(0, 999);
     $selector = "gallery-{$rand_id}";
     $style = '';
     $class = $class ? "{$class} " : '';
     // add space
     $class .= "wolf-images-gallery clearfix hover-{$hover_effect}";
     if ($carousel) {
         $class .= " carousel-mosaic-gallery owl-carousel";
     } else {
         $class .= " mosaic-gallery";
     }
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     $output = "<div class='{$class}' id='{$selector}'{$style}>";
     $i = 0;
     foreach ($images as $image_id) {
         if ($i % 6 == 0) {
             if ($i == 0) {
                 $output .= "\n";
                 $output .= '<div class="slide block">';
                 $output .= "\n";
             } elseif ($i != count($images)) {
                 $output .= '</div><!--.block-->';
                 $output .= "\n";
                 $output .= '<div class="slide block">';
                 $output .= "\n";
             } else {
                 $output .= '</div><!--.block-->';
                 $output .= "\n";
             }
         }
         /* Images sizes */
         if ($i % 6 == 1) {
             $size = '2x1';
         } elseif ($i % 6 == 3) {
             $size = '1x2';
         } elseif ($i % 6 == 5) {
             $size = '2x1';
         } else {
             $size = '2x2';
         }
         $i++;
         $attachment = get_post($image_id);
         if ($attachment) {
             $image_url = esc_url(wolf_get_url_from_attachment_id($image_id, $size));
             $file = esc_url(wolf_get_url_from_attachment_id($image_id, 'extra-large'));
             $image_page = get_attachment_link($image_id);
             $href = 'post' == $link || 'attachment' == $link ? $image_page : $file;
             $class = 'file' == $link ? 'lightbox image-item' : 'image-item';
             $title = wptexturize($attachment->post_title);
             $post_excerpt = esc_attr(wolf_sample(wptexturize($attachment->post_excerpt), 88));
             $title_attr = $post_excerpt ? " title='{$post_excerpt}'" : '';
             if ('none' != $link) {
                 $output .= "<a{$title_attr} href='{$href}' class='{$class}' rel='{$selector}'>";
                 $output .= "\n";
             } else {
                 $output .= "<span class='{$class}'>";
                 $output .= "\n";
             }
             $output .= "<img src='{$image_url}' alt='{$title}'>";
             $output .= "\n";
             if ('none' != $link) {
                 $output .= '</a>';
                 $output .= "\n";
             } else {
                 $output .= '</span>';
                 $output .= "\n";
             }
         }
     }
     // end for each
     $output .= '</div><!--.block-->';
     $output .= "\n";
     $output .= '</div><!--.wolf-images-gallery-->';
     if (array() != $images) {
         return $output;
     }
 }
    /**
     * Woocommerce mosaic category shortcode
     *
     * @param array $atts
     * @return string
     */
    function wolf_woocommerce_categories_shortcode($atts)
    {
        if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
            $atts = vc_map_get_attributes('wolf_woocommerce_categories', $atts);
        }
        extract(shortcode_atts(array('layout' => 'classic-thumb', 'columns' => 3, 'padding' => 'yes', 'exclude' => '', 'include' => ''), $atts));
        $padding = sanitize_text_field($padding);
        $exclude = sanitize_text_field($exclude);
        $include = sanitize_text_field($include);
        $layout = sanitize_text_field(wolf_get_image_size($layout));
        $columns = absint($columns);
        $include_ids = array();
        if ('' != $include) {
            $include = explode(',', str_replace(' ', '', $include));
            foreach ($include as $slug) {
                $cat = get_term_by('slug', $slug, 'product_cat');
                $include_ids[] = $cat->term_id;
            }
        }
        $exclude_ids = array();
        if ('' != $exclude) {
            $exclude = explode(',', str_replace(' ', '', $exclude));
            foreach ($exclude as $slug) {
                $cat = get_term_by('slug', $slug, 'product_cat');
                $exclude_ids[] = $cat->term_id;
            }
        }
        $output = '';
        include_once WC()->plugin_path() . '/includes/walkers/class-product-cat-list-walker.php';
        $cats_args = array('taxonomy' => 'product_cat', 'parent' => 0, 'show_count' => 0, 'pad_counts' => 0, 'hide_empty' => 1, 'title_li' => '', 'menu_order' => 'asc', 'walker' => new WC_Product_Cat_List_Walker());
        if ('' != $include) {
            $cats_args['include'] = $include_ids;
        }
        if ('' != $exclude) {
            $cats_args['exclude'] = $exclude_ids;
        }
        $cats = get_categories($cats_args);
        if (array() != $cats) {
            $rand_id = rand(0, 999);
            $selector = "shop-categories-{$rand_id}";
            if ('mosaic' == $layout) {
                $output .= "<div class='mosaic-shop-categories-container' id='{$selector}'>";
            } else {
                $columns = intval($columns);
                $itemwidth = $columns > 0 ? floor(100 / $columns) : 100;
                $float = is_rtl() ? 'right' : 'left';
                $css = "<style type='text/css'>\r\n\t\t\t\t\t#{$selector} .mosaic-shop-category{\r\n\t\t\t\t\t\tfloat: {$float};\r\n\t\t\t\t\t\twidth: {$itemwidth}%;\r\n\r\n\t\t\t\t";
                if ('yes' == $padding) {
                    $css .= "padding:1rem;";
                }
                if (1 == $columns) {
                    $css .= 'padding-bottom:10px!important;';
                }
                $css .= '}</style>';
                $output .= wolf_compact_css($css);
                $output .= "<div class='shop-categories-container' id='{$selector}'>";
            }
            foreach ($cats as $cat) {
                $title = $cat->name;
                $thumbnail_id = get_woocommerce_term_meta($cat->term_id, 'thumbnail_id', true);
                $link = get_term_link($cat);
                $class = 'mosaic-shop-category product-cat';
                $size = $layout;
                if ('mosaic' == $layout) {
                    $size = get_woocommerce_term_meta($cat->term_id, 'thumbnail_size', true);
                    if ('2x1' == $size) {
                        $class .= ' width2 wide';
                    } elseif ('2x2' == $size) {
                        $class .= ' width2 height2 big';
                    }
                }
                $img_url = wolf_get_url_from_attachment_id(absint($thumbnail_id), $size);
                if ($thumbnail_id) {
                    $output .= "<div class='{$class}'>\r\n\t\t\t\t\t\t<figure class='effect-edouard'>\r\n\t\t\t\t\t\t\t<img src='{$img_url}'>\r\n\t\t\t\t\t\t\t<figcaption>\r\n\t\t\t\t\t\t\t\t<div class='figcaption-inner table'>\r\n\t\t\t\t\t\t\t\t\t<div class='table-cell' >\r\n\t\t\t\t\t\t\t\t\t\t<a href='{$link}' class='mask-link'></a>\r\n\t\t\t\t\t\t\t\t\t\t<h2 class='category-title'>{$title}</h2>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</figcaption>\r\n\t\t\t\t\t\t</figure>\r\n\t\t\t\t\t</div>";
                }
            }
            // endforeach
            $output .= '</div>';
            if ('mosaic' == $layout) {
                wp_enqueue_script('packery');
                $output .= '<script type="text/javascript">jQuery(document).ready(function(){';
                $output .= 'jQuery( ".mosaic-shop-categories-container" ).imagesLoaded( function() {
					jQuery( ".mosaic-shop-categories-container" ).isotope( {
						itemSelector : ".mosaic-shop-category",
						//animationEngine : "none",
						layoutMode: "packery"
					} );
				});';
                $output .= '});</script>';
            }
        }
        // endif
        return $output;
    }
예제 #23
0
/**
 * Inline CSS with the theme options
 */
function wolf_theme_options_css()
{
    $css = '';
    /*-----------------------------------------------------------------------------------*/
    /*  Accent Color
    	/*-----------------------------------------------------------------------------------*/
    $accent = wolf_get_theme_option('accent_color');
    if ($accent) {
        $css .= "\r\n\t\ta,\r\n\t\t.add_to_cart_button:hover,\r\n\t\t.wolf-button:hover,\r\n\t\tinput[type='submit']:hover,\r\n\t\tinput[type='reset']:hover,\r\n\t\t.wolf-social:hover,\r\n\t\t.wolf-show-ticket-button:hover,\r\n\t\t.team-member-social-container a:hover,\r\n\t\th1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,\r\n\t\t.content-light-font h1 a:hover, .content-light-font h2 a:hover,\r\n\t\t.content-light-font h3 a:hover, .content-light-font h4 a:hover,\r\n\t\t.content-light-font h5 a:hover, .content-light-font h6 a:hover,\r\n\t\t.site-footer a:hover,\r\n\t\t#site-navigation-secondary a:hover,\r\n\t\t.comment-reply-link,\r\n\t\t.widget a:not(.button):not(.wolf-button):hover,\r\n\t\tfigure.effect-sadie .entry-meta a,\r\n\t\t#top-bar #lang_sel a.lang_sel_sel:hover,\r\n\t\t.video-sidebar-container .video-title a:hover,\r\n\t\t.video-category .video-author-name a:hover,\r\n\t\t.single-video .video-author-meta .video-author-name a:hover,\r\n\t\t.has-bg h2.entry-title a:hover,\r\n\t\t.post-archives .entry-content a:hover,\r\n\t\t.video-youtube-all.single-video .video-author-meta .video-author-name a:hover,\r\n\t\t.video-youtube.single-video .video-author-meta .video-author-name a:hover,\r\n\t\t.wolf-bigtweet-content:before{\r\n\t\t\tcolor:{$accent};\r\n\t\t}\r\n\r\n\r\n\t\t.entry-meta a:hover, .edit-link a:hover,\r\n\t\t#work-filter a.active, #work-filter a:hover, #video-filter a.active,\r\n\t\t#video-filter a:hover, #gallery-filter a.active, #gallery-filter a:hover,\r\n\t\t#plugin-filter a.active, #plugin-filter a:hover,\r\n\t\t#theme-filter a.active, #theme-filter a:hover,\r\n\t\t#demo-filter a.active, #demo-filter a:hover,\r\n\t\t.menu-hover-text-color .nav-menu li a:hover,\r\n\t\t.menu-hover-text-color .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-text-color .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-hover-text-color .nav-menu li.active a:first-child,\r\n\t\tinput[type='submit']#place_order:hover{\r\n\t\t\tcolor:{$accent}!important;\r\n\t\t}\r\n\r\n\t\ta#scroll-down:hover,\r\n\t\ta#top-arrow:hover,\r\n\t\tinput[type='submit'],\r\n\t\tinput[type='reset'],\r\n\t\t.wolf-button,\r\n\t\t.button,\r\n\t\t.add_to_cart_button,\r\n\t\t.wolf-show-ticket-button{\r\n\t\t\tbackground:{$accent};\r\n\t\t\tborder-color:{$accent};\r\n\t\t}\r\n\r\n\t\t.content-light-font .border-button-accent-hover:hover,\r\n\t\t.border-button-accent-hover:hover,\r\n\t\t.trigger,\r\n\t\t.sidebar-footer input[type='submit'].wolf-mailchimp-submit:hover,\r\n\t\tinput[type='submit']#place_order{\r\n\t\t\tbackground:{$accent}!important;\r\n\t\t\tborder-color:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t.sidebar-footer .wolf-mailchimp-email:focus,\r\n\t\t.bypostauthor .avatar{\r\n\t\t\tborder-color:{$accent};\r\n\t\t}\r\n\r\n\r\n\t\t.wolf-social.square:hover, .wolf-social.circle:hover {\r\n\t\t\tbackground: {$accent};\r\n\t\t\tborder-color: {$accent};\r\n\t\t}\r\n\r\n\t\t.vc_progress_bar .vc_single_bar .vc_bar,\r\n\t\t.mejs-container .mejs-controls .mejs-time-rail .mejs-time-current,\r\n\t\t.mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{\r\n\t\t\tbackground:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t.wolf-social.hover-fill-in.square:hover,\r\n\t\t.wolf-social.hover-fill-in.circle:hover,\r\n\t\t.wolf-social.circle.wolf-social-no-custom-style.hover-fill-in:hover,\r\n\t\t.wolf-social.square.wolf-social-no-custom-style.hover-fill-in:hover,\r\n\t\t.icon-box.icon-type-circle .wolf-icon-no-custom-style.hover-fill-in:hover,\r\n\t\t.icon-box.icon-type-square .wolf-icon-no-custom-style.hover-fill-in:hover{\r\n\t\t\t-webkit-box-shadow: inset 0 0 0 1em {$accent};\r\n\t\t\tbox-shadow: inset 0 0 0 1em {$accent};\r\n\t\t\tborder-color: {$accent};\r\n\t\t}\r\n\r\n\t\t.icon-box.icon-type-circle .wolf-icon-no-custom-style.hover-none:hover,\r\n\t\t.icon-box.icon-type-square .wolf-icon-no-custom-style.hover-none:hover{\r\n\t\t\tbackground:{$accent};\r\n\t\t\tborder-color:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t.pricing-table-currency,\r\n\t\t.pricing-table-price,\r\n\t\t.pricing-table-strike:before{\r\n\t\t\tcolor:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t#navbar-container .nav-menu li.button-style > a:first-child span,\r\n\t\t#navbar-container-left .nav-menu li.button-style > a:first-child span,\r\n\t\t#navbar-mobile .nav-menu li.button-style > a:first-child span{\r\n\t\t\tbackground-color:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t#navbar-container .nav-menu li.button-style > a:first-child span:hover,\r\n\t\t#navbar-container-left .nav-menu li.button-style > a:first-child span:hover,\r\n\t\t#navbar-mobile .nav-menu li.button-style > a:first-child span:hover{\r\n\t\t\tbackground:" . wolf_color_brightness($accent, -8) . ";\r\n\t\t}\r\n\r\n\t\tfigure.effect-sadie .item-icon,\r\n\t\t#infscr-loading,\r\n\t\t.shortcode-videos-grid figure,\r\n\t\t.shortcode-works-grid figure,\r\n\t\t.shortcode-plugins-grid figure,\r\n\t\t.shortcode-albums-grid figure,\r\n\t\t.pricing-table-featured,\r\n\t\t.pricing-table-inner ul li.pricing-table-button a:hover,\r\n\t\t.pricing-table-active ul li.pricing-table-button a ,\r\n\t\t.nav-menu .product-count, .menu .product-count,\r\n\t\t.woocommerce .widget_price_filter .ui-slider .ui-slider-range,\r\n\t\t.woocommerce-page .widget_price_filter .ui-slider .ui-slider-range,\r\n\t\t.woocommerce span.onsale,\r\n\t\t.woocommerce-page span.onsale,\r\n\t\t.woocommerce .woocommerce-tabs .panel,\r\n\t\t.woocommerce-page .woocommerce-tabs .panel,\r\n\t\t.woocommerce .woocommerce-tabs ul.tabs li.active,\r\n\t\t.woocommerce-page .woocommerce-tabs ul.tabs li.active,\r\n\t\t.pricing-table-price-strike:before,\r\n\t\t.notif-count{\r\n\t\t\tbackground:{$accent};\r\n\t\t}\r\n\r\n\t\t::-moz-selection{\r\n\t\t\tbackground-color:{$accent}!important;\r\n\t\t}\r\n\r\n\t\t::selection{\r\n\t\t\tbackground-color:{$accent}!important;\r\n\t\t}\r\n";
    }
    if ('standard' == wolf_get_theme_option('home_header_type') && !wolf_is_slider_in_home_header()) {
        $css .= wolf_get_background_css('.is-home-header .parallax-inner', 'header_bg');
    }
    $css .= wolf_get_background_css('.is-home-header .hero-inner', 'header_bg');
    $css .= wolf_get_background_css('.footer-holder', 'footer_holder_bg');
    $holder_overlay_img = wolf_get_theme_option('footer_holder_overlay_img');
    $holder_overlay_pattern = $holder_overlay_img ? esc_url(wolf_get_url_from_attachment_id($holder_overlay_img)) : '';
    $holder_overlay_opacity = wolf_get_theme_option('footer_holder_overlay_opacity');
    $holder_overlay_color = wolf_get_theme_option('footer_holder_overlay_color');
    if ($holder_overlay_color) {
        $css .= ".footer-holder-overlay{background-color:{$holder_overlay_color};}";
    }
    if ($holder_overlay_pattern) {
        $css .= ".footer-holder-overlay{background-image:url({$holder_overlay_pattern});}";
    }
    if ($holder_overlay_opacity) {
        $css .= '.footer-holder-overlay{opacity:' . $holder_overlay_opacity / 100 . '}';
    }
    if ('dark' == wolf_get_theme_option('header_bg_font_color') && is_page_template('page-templates/home.php')) {
        $css .= "\r\n\t\t\t.menu-transparent.is-home-header #navbar-container .nav-menu li a,\r\n\t\t\t.menu-semi-transparent.is-home-header #navbar-container .nav-menu li a{\r\n\t\t\t\tcolor: #333;\r\n\t\t\t}\r\n\r\n\t\t\t.menu-transparent.is-home-header #navbar-container .nav-menu li a:hover,\r\n\t\t\t.menu-semi-transparent.is-home-header #navbar-container .nav-menu li a:hover{\r\n\t\t\t\tcolor: #0d0d0d;\r\n\t\t\t}\r\n\r\n\t\t\t.menu-transparent.is-home-header .logo-light{\r\n\t\t\t\topacity:0;\r\n\t\t\t}\r\n\r\n\t\t\t.menu-transparent.is-home-header .logo-dark{\r\n\t\t\t\topacity:1;\r\n\t\t\t}\r\n\r\n\t\t\t.menu-border.menu-transparent #navbar-container,\r\n\t\t\t.menu-border.menu-semi-transparent #navbar-container{\r\n\t\t\t\tborder-bottom: 1px solid rgba(0,0,0,.1);\r\n\t\t\t}\r\n\t\t";
        if (!wolf_get_theme_option('sub_menu_bg_color')) {
            $css .= "\r\n\t\t\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li:hover a,\r\n\t\t\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li:hover a,\r\n\t\t\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li.current-menu-item > a:first-child,\r\n\t\t\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li.current-menu-item > a:first-child,\r\n\t\t\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li.current-menu-ancestor > a:first-child {\r\n\t\t\t\t\t-webkit-box-shadow: inset 0px 3px 0px 0px #0d0d0d;\r\n\t\t\t\t\tbox-shadow: inset 0px 3px 0px 0px #0d0d0d;\r\n\t\t\t\t}\r\n\t\t\t";
        }
    }
    if (!wolf_is_slider_in_home_header()) {
        $overlay_img = wolf_get_theme_option('header_overlay_img');
        $overlay_pattern = $overlay_img ? esc_url(wolf_get_url_from_attachment_id($overlay_img)) : '';
        $overlay_opacity = wolf_get_theme_option('header_overlay_opacity');
        $overlay_color = wolf_get_theme_option('header_overlay_color');
        if ($overlay_color) {
            $css .= ".is-home-header .header-overlay{background-color:{$overlay_color};}";
        }
        if ($overlay_pattern) {
            $css .= ".is-home-header .header-overlay{background-image:url({$overlay_pattern});}";
        }
        if ($overlay_opacity) {
            $css .= '.is-home-header .header-overlay{opacity:' . $overlay_opacity / 100 . '}';
        }
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Sub menu bg color
    	/*-----------------------------------------------------------------------------------*/
    $sub_menu_bg_color = wolf_get_theme_option('sub_menu_bg_color');
    if ($sub_menu_bg_color) {
        $css .= "\r\n\r\n\t\t#navbar-container .nav-menu li.cart-menu-item .cart-menu-panel,\r\n\t\t#navbar-container .nav-menu li ul.sub-menu,\r\n\t\t#navbar-container .nav-menu li ul.children,\r\n\t\t.menu-hover-plain-color #navbar-container .nav-menu li:hover a,\r\n\t\t.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-hover-plain-color #navbar-container .nav-menu li.active > a:first-child,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li:hover a,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li.active > a:first-child{\r\n\t\t\tbackground-color:{$sub_menu_bg_color}!important;\r\n\t\t}\r\n\r\n\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li:hover a,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li:hover a,\r\n\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-border-top.menu-transparent.is-home-header .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.is-home-header .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-hover-border-top.menu-transparent.has-header-image.show-title-area .nav-menu li:hover a,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.has-header-image.show-title-area .nav-menu li:hover a,\r\n\t\t.menu-hover-border-top.menu-transparent.has-header-image.show-title-area .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-border-top.menu-transparent.has-header-image.show-title-area .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.has-header-image.show-title-area .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-hover-border-top.menu-semi-transparent.has-header-image.show-title-area .nav-menu li.current-menu-ancestor > a:first-child {\r\n\t\t\t-webkit-box-shadow: inset 0px 3px 0px 0px {$sub_menu_bg_color};\r\n\t\t\tbox-shadow: inset 0px 3px 0px 0px {$sub_menu_bg_color};\r\n\t\t}\r\n\t";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Sub bg color
    	/*-----------------------------------------------------------------------------------*/
    $sub_menu_color = wolf_get_theme_option('sub_menu_color');
    if ($sub_menu_color) {
        $css .= "\r\n\t\t/*#navbar-container-right .wolf-social,\r\n\t\t#navbar-container-right .widget-title,\r\n\t\t#navbar-container-right,\r\n\t\t#navbar-container-right a,\r\n\t\t#navbar-container-right a:hover,\r\n\t\t#navbar-container-right .wolf-twitter-widget ul.wolf-tweet-list li:before,*/\r\n\t\t.wolf #navbar-container .nav-menu li.cart-menu-item .cart-menu-panel a,\r\n\t\t.wolf #navbar-container .nav-menu li ul.sub-menu span,\r\n\t\t.wolf #navbar-container .nav-menu li ul.children span,\r\n\t\t.wolf #navbar-container .nav-menu li ul.sub-menu li:before,\r\n\t\t.wolf #navbar-container .nav-menu li ul.children li:before,\r\n\t\t.menu-dark.menu-hover-plain-color .nav-menu li:hover a,\r\n\t\t.menu-dark.menu-hover-plain-color .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-dark.menu-hover-plain-color .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.menu-light.menu-hover-plain-color .nav-menu li:hover a,\r\n\t\t.menu-light.menu-hover-plain-color .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.menu-light.menu-hover-plain-color .nav-menu li.current-menu-ancestor > a:first-child,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li:hover a,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-item > a:first-child,\r\n\t\t.sticky-menu.menu-hover-plain-color #navbar-container .nav-menu li.current-menu-ancestor > a:first-child{\r\n\t\t\tcolor:{$sub_menu_color}!important;\r\n\t\t}\r\n";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Loader
    	/*-----------------------------------------------------------------------------------*/
    $spinner_color = wolf_get_theme_option('spinner_color');
    $loading_overlay_color = wolf_get_theme_option('loading_overlay_color');
    if ($loading_overlay_color) {
        $css .= "#loading-overlay{background:{$loading_overlay_color}}";
    }
    if ($spinner_color) {
        $css .= ".loader2-double-bounce1,\r\n\t\t.loader2-double-bounce2,\r\n\t\t.loader3 > div,\r\n\t\t.loader4-cube1,\r\n.loader4-cube2,\r\n.loader5,\r\n.loader6-dot1, .loader6-dot2,\r\n.loader7 > div,\r\n.loader8-container1 > div, .loader8-container2 > div, .loader8-container3 > div\r\n{background-color:{$spinner_color}}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Overlay Menu
    	/*-----------------------------------------------------------------------------------*/
    $overlay_menu_bg = wolf_get_theme_option('overlay_menu_bg');
    $overlay_opacity = wolf_get_theme_option('overlay_menu_bg_opacity');
    $overlay_opacity = $overlay_opacity ? $overlay_opacity / 100 : 1;
    if ($overlay_menu_bg) {
        $css .= '
			#navbar-container-overlay{
				background-color:rgba(' . wolf_hex_to_rgb($overlay_menu_bg) . ', ' . $overlay_opacity . ');
			}
		';
    }
    $overlay_menu_color = wolf_get_theme_option('overlay_menu_color');
    if ($overlay_menu_color) {
        $css .= '
			#navbar-container-overlay,
			#navbar-container-overlay a{
				color:' . $overlay_menu_color . '!important;
			}
		';
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Entry Meta
    	/*-----------------------------------------------------------------------------------*/
    $entry_meta_font = wolf_get_theme_option('entry_meta_font_name');
    $entry_meta_selectors = '.entry-meta, .category, .edit-link, .author-link, .author-description, .share-link,
	.page-title-container .subheading, .page-title-container .category-description p';
    if ($entry_meta_font) {
        $css .= "{$entry_meta_selectors}{font-family:'{$entry_meta_font}'}";
    }
    $entry_meta_font_weight = wolf_get_theme_option('entry_meta_font_weight');
    if ($entry_meta_font_weight) {
        $css .= "{$entry_meta_selectors}{font-weight:{$entry_meta_font_weight}}";
    }
    $entry_meta_font_transform = wolf_get_theme_option('entry_meta_font_transform');
    if ('uppercase' == $entry_meta_font_transform) {
        $css .= "{$entry_meta_selectors}{text-transform:uppercase}";
    }
    $entry_meta_font_style = wolf_get_theme_option('entry_meta_font_style');
    if ($entry_meta_font_style) {
        $css .= "{$entry_meta_selectors}{font-style:{$entry_meta_font_style}}";
    }
    $entry_meta_letterspacing = wolf_get_theme_option('entry_meta_font_letter_spacing');
    if ($entry_meta_letterspacing) {
        $entry_meta_letterspacing = $entry_meta_letterspacing . 'px';
        $css .= "{$entry_meta_selectors}{letter-spacing:{$entry_meta_letterspacing}}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Heading Font
    	/*-----------------------------------------------------------------------------------*/
    $heading_font = wolf_get_theme_option('heading_font_name');
    $heading_selectors = 'h1, h2, h3, h4, h5, h2.entry-title, .widget-title, .counter-text, .countdown-period, .wolf-slide-title';
    if ($heading_font) {
        $css .= "{$heading_selectors}{font-family:'{$heading_font}'}";
    }
    $heading_font_weight = wolf_get_theme_option('heading_font_weight');
    if ($heading_font_weight) {
        $css .= "{$heading_selectors}{font-weight:{$heading_font_weight}}";
    }
    $heading_font_transform = wolf_get_theme_option('heading_font_transform');
    if ('uppercase' == $heading_font_transform) {
        $css .= "{$heading_selectors}{text-transform:uppercase}";
    }
    $heading_font_style = wolf_get_theme_option('heading_font_style');
    if ($heading_font_style) {
        $css .= "{$heading_selectors}{font-style:{$heading_font_style}}";
    }
    $heading_letterspacing = wolf_get_theme_option('heading_font_letter_spacing');
    if ($heading_letterspacing) {
        $heading_letterspacing = $heading_letterspacing . 'px';
        $css .= "{$heading_selectors}{letter-spacing:{$heading_letterspacing}}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Page title Font
    	/*-----------------------------------------------------------------------------------*/
    $page_title_font = wolf_get_theme_option('page_title_font_name');
    $page_title_selectors = 'h1.page-title';
    if ($page_title_font) {
        $css .= "{$page_title_selectors}{font-family:'{$page_title_font}'}";
    }
    $page_title_font_weight = wolf_get_theme_option('page_title_font_weight');
    if ($page_title_font_weight) {
        $css .= "{$page_title_selectors}{font-weight:{$page_title_font_weight}}";
    }
    $page_title_font_transform = wolf_get_theme_option('page_title_font_transform');
    if ('uppercase' == $page_title_font_transform) {
        $css .= "{$page_title_selectors}{text-transform:uppercase}";
    }
    $page_title_font_style = wolf_get_theme_option('page_title_font_style');
    if ($page_title_font_style) {
        $css .= "{$page_title_selectors}{font-style:{$page_title_font_style}}";
    }
    $page_title_letterspacing = wolf_get_theme_option('page_title_font_letter_spacing');
    if ($page_title_letterspacing) {
        $page_title_letterspacing = $page_title_letterspacing . 'px';
        $css .= "{$heading_selectors}{letter-spacing:{$heading_letterspacing}}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Menu Font
    	/*-----------------------------------------------------------------------------------*/
    $menu_font = wolf_get_theme_option('menu_font_name');
    $menu_selectors = '.nav-menu li a, #navbar-container-right';
    if ($menu_font) {
        $css .= "{$menu_selectors}{ font-family:'{$menu_font}'}";
    }
    $menu_font_weight = wolf_get_theme_option('menu_font_weight');
    if ($menu_font_weight) {
        $css .= "{$menu_selectors}{font-weight:{$menu_font_weight}}";
    }
    $menu_font_transform = wolf_get_theme_option('menu_font_transform');
    if ('uppercase' == $menu_font_transform) {
        $css .= "{$menu_selectors}{text-transform:uppercase}";
    }
    $menu_font_style = wolf_get_theme_option('menu_font_style');
    if ($menu_font_style) {
        $css .= "{$menu_selectors}{font-style:{$menu_font_style}}";
    }
    $menu_letterspacing = wolf_get_theme_option('menu_font_letter_spacing');
    if ($menu_letterspacing) {
        $menu_letterspacing = $menu_letterspacing . 'px';
        $css .= "{$menu_selectors}{letter-spacing:{$menu_letterspacing}}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Body Font
    	/*-----------------------------------------------------------------------------------*/
    $body_font = wolf_get_theme_option('body_font_name');
    $body_selectors = 'body, blockquote.testimonial-content, .wolf-slide-subtitle';
    if ($body_font) {
        $css .= "{$body_selectors}{font-family:'{$body_font}'}";
    }
    /*-----------------------------------------------------------------------------------*/
    /*  Backgrounds
    	/*-----------------------------------------------------------------------------------*/
    if ('boxed' == wolf_get_theme_option('layout')) {
        $css .= wolf_get_background_css('body.wolf', 'body_bg');
    }
    if ('boxed' == wolf_get_theme_option('layout') && (wolf_get_theme_option('body_bg_color') || wolf_get_theme_option('body_bg_img'))) {
        $css .= '#page{background:none;}';
    }
    // page
    //$css .= wolf_get_background_css( '.wolf #page-content', 'page_bg' );
    if ('light' == wolf_get_theme_option('page_bg_font_color')) {
        $css .= "\r\n\t\t\tbody{\r\n\t\t\t\tcolor:white;\r\n\t\t\t}\r\n\t\t";
    }
    // footer
    $css .= wolf_get_background_css('site_footer_bg', '.site-footer');
    /*-----------------------------------------------------------------------------------*/
    /*  Custom CSS
    	/*-----------------------------------------------------------------------------------*/
    if (wolf_get_theme_option('c')) {
        $css .= stripslashes(wolf_get_theme_option('c'));
    }
    if (get_option('wolf_theme_css_' . wolf_get_theme_slug())) {
        $css .= stripslashes(get_option('wolf_theme_css_' . wolf_get_theme_slug()));
    }
    if (WOLF_DEBUG) {
        return $css;
    } else {
        return wolf_compact_css($css);
    }
}
 /**
  * Team Member shortcode
  *
  * @param array $atts
  * @return string
  */
 function wolf_shortcode_member($atts)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_team_member', $atts);
     }
     global $team_member_socials, $ti_icons;
     extract(shortcode_atts(array('photo' => '', 'link' => '', 'image_style' => '', 'alignment' => '', 'name' => '', 'title_tag' => 'h3', 'role' => '', 'tagline' => '', 'animation' => '', 'animation_delay' => '', 'inline_style' => '', 'class' => ''), $atts));
     $image_style = sanitize_text_field($image_style);
     $name = sanitize_text_field($name);
     //$tagline = sanitize_text_field( $tagline );
     $role = sanitize_text_field($role);
     $alignment = esc_attr($alignment);
     $animation = sanitize_text_field($animation);
     $animation_delay = absint($animation_delay);
     $inline_style = sanitize_text_field($inline_style);
     $class = esc_attr($class);
     $title_tag = esc_attr($title_tag);
     $link = vc_build_link($link);
     $url = esc_url($link['url']);
     $target = $link['target'];
     $title = $link['title'];
     foreach ($team_member_socials as $social) {
         $default_atts[$social] = '';
     }
     $size = 'classic-thumb';
     if ('square' == $image_style || 'round' == $image_style) {
         $size = '1x1';
     }
     if ('portrait' == $image_style) {
         $size = 'portrait';
     }
     $style = '';
     $class .= "team-member-container text-{$alignment}";
     if ('round' == $image_style) {
         $class .= " round";
     }
     if ($animation) {
         $class .= " wow {$animation}";
     }
     if ($animation_delay && 'none' != $animation) {
         $style .= 'animation-delay:' . absint($animation_delay) / 1000 . 's;-webkit-animation-delay:' . absint($animation_delay) / 1000 . 's;';
     }
     if ($inline_style) {
         $style .= $inline_style;
     }
     $style = $style ? " style='{$style}'" : '';
     $output = "<div class='{$class}'{$style}>";
     $photo = $photo ? wolf_get_url_from_attachment_id($photo, $size) : '';
     if ($photo) {
         $output .= "<div class='team-member-photo'>";
         if ('http://' != $url && $url) {
             $output .= '<a href="' . esc_url($url) . '" title="' . esc_attr($title) . '" target="' . esc_attr($target) . '">';
         }
         $output .= "<img src='{$photo}' alt='team-member'>";
         if ('http://' != $url && $url) {
             $output .= '</a>';
         }
         $output .= "</div>";
     }
     $headings_array = array('h2', 'h3', 'h4', 'h5', 'h6');
     $title_tag = in_array($title_tag, $headings_array) ? $title_tag : 'h3';
     if ($name) {
         $output .= "<{$title_tag} class='team-member-name'>{$name}</{$title_tag}>";
     }
     if ($role) {
         $output .= "<span class='team-member-role'>{$role}</span>";
     }
     if ($tagline) {
         $output .= "<div class='team-member-tagline'><p>{$tagline}</p></div>";
     }
     $output .= '<div class="team-member-social-container">';
     foreach ($team_member_socials as $social) {
         if (!empty($atts[$social])) {
             $prefix = in_array('ti-' . $social, array_keys($ti_icons)) ? 'ti' : 'fa fa';
             $output .= "<a href='" . $atts[$social] . "' class='{$prefix}-{$social}' title='{$social}' target='_blank'></a>";
         }
     }
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
예제 #25
0
 /**
  * Add show column in admin posts list
  *
  * @param string $column_name
  * @param int $post_id
  */
 public function admin_columns_content_slides($column_name, $post_id)
 {
     if ($column_name == 'slide_image') {
         $img_meta = get_post_meta($post_id, '_wolf_slide_image_img', true);
         $mp4_meta = get_post_meta($post_id, '_wolf_slide_video_mp4', true);
         if ($img_meta) {
             $src = wolf_get_url_from_attachment_id(absint($img_meta));
             echo '<img src="' . esc_url($src) . '" alt="slide-image" width="80" height="80">';
         } elseif ($mp4_meta) {
             $path = parse_url(esc_url($mp4_meta), PHP_URL_PATH);
             $path_fragments = explode('/', $path);
             $end = end($path_fragments);
             echo esc_attr($end);
         }
     }
 }
    /**
     * Display Page Title
     */
    function wolf_output_title()
    {
        $post_id = wolf_get_header_post_id();
        $hide_title_area = 'none' == wolf_get_theme_option('page_header_type');
        if (get_post_meta($post_id, '_page_header_type', true)) {
            $hide_title_area = 'none' == get_post_meta($post_id, '_page_header_type', true);
        }
        if ($post_id && wolf_get_page_title() && !$hide_title_area && !is_front_page() && !is_page_template('page-templates/home.php')) {
            $type = get_post_meta($post_id, '_header_bg_type', true) ? get_post_meta($post_id, '_header_bg_type', true) : 'image';
            $video_mp4 = get_post_meta($post_id, '_header_video_bg_mp4', true);
            $video_webm = get_post_meta($post_id, '_header_video_bg_webm', true);
            $video_ogv = get_post_meta($post_id, '_header_video_bg_ogv', true);
            $video_img = get_post_meta($post_id, '_header_video_bg_img', true);
            $video_opacity = absint(get_post_meta($post_id, '_header_video_bg_opacity', true)) / 100;
            $video_bg_type = get_post_meta($post_id, '_header_video_bg_type', true) ? get_post_meta($post_id, '_header_video_bg_type', true) : 'selfhosted';
            $video_youtube_url = get_post_meta($post_id, '_header_video_bg_youtube_url', true);
            $image_id = get_post_meta($post_id, '_header_bg_img', true);
            $header_effect = get_post_meta($post_id, '_header_bg_effect', true);
            $do_parallax = 'parallax' == $header_effect;
            $full_screen = 'full' == get_post_meta($post_id, '_page_header_type', true);
            if (wolf_get_category_meta('header_bg_img') && 'image' == wolf_get_category_meta('header_bg_type')) {
                $type = 'image';
                $image_id = wolf_get_category_meta('header_bg_img');
                $header_effect = wolf_get_category_meta('header_bg_effect');
                $do_parallax = 'parallax' == $header_effect;
                $full_screen = 'full' == wolf_get_category_meta('page_header_type');
            }
            if ('video' == wolf_get_category_meta('header_bg_type')) {
                $type = 'video';
                $video_mp4 = wolf_get_category_meta('header_video_bg_mp4');
                $video_webm = wolf_get_category_meta('header_video_bg_webm');
                $video_ogv = wolf_get_category_meta('header_video_bg_ogv');
                $video_opacity = absint(wolf_get_category_meta('header_video_bg_opacity')) / 100;
                $video_img = wolf_get_category_meta('header_video_bg_img');
                $video_bg_type = wolf_get_category_meta('header_video_bg_type');
                $video_youtube_url = wolf_get_category_meta('header_video_bg_youtube_url');
            }
            $class = 'page-header-container';
            $_image = esc_url(wolf_get_url_from_attachment_id($image_id, 'extra-large'));
            if ($do_parallax && $image_id) {
                $class .= ' section-parallax';
            }
            if ($full_screen) {
                $class .= ' full-height';
            }
            echo '<section class="' . esc_attr($class) . '">';
            if ('video' == $type && !is_search()) {
                ?>
				<div class="video-container">
					<?php 
                if ($video_mp4 && 'selfhosted' == $video_bg_type) {
                    echo wolf_video_bg($video_mp4, $video_webm, $video_ogv, $video_img);
                } elseif ($video_youtube_url && 'youtube' == $video_bg_type) {
                    // debug(  $video_img );
                    echo wolf_youtube_video_bg($video_youtube_url, $video_img);
                }
                ?>
				</div>
				<?php 
            }
            if ('zoomin' == $header_effect && $image_id && 'image' == $type && !is_search()) {
                echo '<div class="bg"><img src="' . $_image . '"></div>';
            }
            $page_header_type = wolf_get_theme_option('page_header_type');
            if (get_post_meta($post_id, '_page_header_type', true)) {
                $page_header_type = get_post_meta($post_id, '_page_header_type', true);
                $page_header_type = 'full' == $page_header_type ? 'big' : $page_header_type;
            }
            if (wolf_get_category_meta('page_header_type')) {
                $page_header_type = wolf_get_category_meta('page_header_type');
            }
            echo '<div class="page-header text-center">';
            if ('small' == $page_header_type) {
                if (!get_post_meta($post_id, '_header_hide_title', true)) {
                    echo '<div class="wrap intro">';
                    echo '<div class="breadcrumb">';
                    echo wolf_breadcrumb();
                    echo '</div>';
                    echo '<div class="page-title-container">';
                    echo wolf_get_page_title();
                    echo '</div>';
                    echo '</div>';
                }
            } else {
                if (!get_post_meta($post_id, '_header_hide_title', true)) {
                    echo '<div class="page-title-container intro">';
                    echo wolf_get_page_title();
                    if (is_singular('post')) {
                        echo '<div class="entry-meta">';
                        wolf_post_entry_meta();
                        echo '</div>';
                    }
                    echo '</div>';
                }
            }
            echo '</div><!--.page-header --></section>';
        }
    }
예제 #27
0
 /**
  * Another custom attribute for a single image
  *
  * We will use it for background image
  *
  */
 function single_image_settings_field($settings, $value)
 {
     $img = null;
     $output = '<div class="single_image_block">';
     $output .= '<input type="hidden" class="wpb_vc_param_value wpb-textinput ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" name="' . $settings['param_name'] . '" id="" value="' . absint($value) . '">';
     $output .= '<img ';
     if (!$value) {
         $output .= 'style="display:none;"';
     } else {
         $img = wolf_get_url_from_attachment_id(absint($value), 'thumbnail');
     }
     $output .= ' class="wolf-options-img-preview" src="' . esc_url($img) . '" alt="' . $settings['param_name'] . '">';
     $output .= '<br>';
     $output .= '<a href="#" class="button wolf-options-reset-img">' . __('Clear', 'wolf') . '</a>';
     $output .= '<a href="#" class="button wolf-options-set-img">' . __('Choose an image', 'wolf') . '</a>';
     $output .= '</div>';
     return $output;
 }
        public function edit($cat)
        {
            $options_array_name = $this->options_array_name;
            $cat_id = $cat->term_id;
            $cat_meta_value = $this->validate(get_option("_wolf_post_category_meta_{$cat_id}"));
            foreach ($this->cat_meta as $field) {
                $field_id = sanitize_title($field['id']);
                $type = isset($field['type']) ? $field['type'] : 'text';
                $label = isset($field['label']) ? $field['label'] : 'Label';
                $desc = isset($field['desc']) ? $field['desc'] : '';
                $def = isset($field['def']) ? $field['def'] : '';
                $dependency = isset($field['dependency']) ? $field['dependency'] : array();
                $class = "form-field option-section-{$field_id}";
                $data = '';
                $value = isset($cat_meta_value[$field_id]) ? $cat_meta_value[$field_id] : null;
                if (array() != $dependency) {
                    $class .= ' has-dependency';
                    $data .= ' data-dependency-element="' . $dependency['element'] . '"';
                    $dependency_value = '[';
                    foreach ($dependency['value'] as $value) {
                        $dependency_value .= '"' . $value . '"';
                    }
                    $dependency_value .= ']';
                    $data .= " data-dependency-values='{$dependency_value}'";
                }
                echo "<tr class='{$class}'{$data}>";
                echo '<th scope="row" valign="top">';
                echo '<label for="' . $options_array_name . '[' . $field_id . ']' . '">';
                echo sanitize_text_field($label);
                echo '</label></th><td>';
                /* Type */
                if ('text' == $type || 'int' == $type) {
                    ?>
						<input type="text" name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id);
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id);
                    ?>
]" value="<?php 
                    echo esc_attr($value);
                    ?>
">
						<?php 
                } elseif ('colorpicker' == $type) {
                    ?>
						<input name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id);
                    ?>
]" class="wolf-options-colorpicker" type="text" value="<?php 
                    echo esc_attr($value);
                    ?>
">
						<?php 
                } elseif ('image' == $type) {
                    ?>
						<input type="hidden" name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id);
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id);
                    ?>
]" value="<?php 
                    echo esc_attr($value);
                    ?>
">
						<img style="max-width:250px;display:none;" class="wolf-options-img-preview" src="" alt="<?php 
                    echo sanitize_title($field_id);
                    ?>
">
						<br><a href="#" class="button wolf-options-reset-bg"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
						<a href="#" class="button wolf-options-set-bg"><?php 
                    _e('Choose an image', 'wolf');
                    ?>
</a>
						<?php 
                } elseif ('background' == $type) {
                    $parallax = isset($field['parallax']) ? $field['parallax'] : false;
                    $exclude_params = isset($field['exclude_params']) ? $field['exclude_params'] : array();
                    $bg_meta_color = $cat_meta_value[$field_id . '_color'];
                    $bg_meta_img_id = $cat_meta_value[$field_id . '_img'];
                    $bg_meta_img_url = wolf_get_url_from_attachment_id($bg_meta_img_id);
                    $bg_meta_repeat = $cat_meta_value[$field_id . '_repeat'];
                    $bg_meta_position = $cat_meta_value[$field_id . '_position'];
                    $bg_meta_size = $cat_meta_value[$field_id . '_size'];
                    if (!in_array('color', $exclude_params)) {
                        ?>
							<br><br>
							<p><?php 
                        _e('Background color', 'wolf');
                        ?>
</p>
							<input name="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_color';
                        ?>
]" class="wolf-options-colorpicker" type="text" value="<?php 
                        echo esc_attr($bg_meta_color);
                        ?>
">
							<br><br>
							<?php 
                    }
                    if (!in_array('image', $exclude_params)) {
                        ?>
							<p><?php 
                        _e('Background image', 'wolf');
                        ?>
</p>
							<div>
								<input type="hidden" name="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_img';
                        ?>
]" id="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_img';
                        ?>
]" value="<?php 
                        echo absint($bg_meta_img_id);
                        ?>
">
								<img style="max-width:250px;<?php 
                        if (0 == $bg_meta_img_id) {
                            echo ' display:none;';
                        }
                        ?>
" class="wolf-options-img-preview" src="<?php 
                        echo esc_url($bg_meta_img_url);
                        ?>
" alt="<?php 
                        echo sanitize_title($field_id);
                        ?>
">
								<br><a href="#" class="button wolf-options-reset-bg"><?php 
                        _e('Clear', 'wolf');
                        ?>
</a>
								<a href="#" class="button wolf-options-set-bg"><?php 
                        _e('Choose an image', 'wolf');
                        ?>
</a>
							</div>
							<br><br>
							<?php 
                    }
                    if (!in_array('repeat', $exclude_params)) {
                        /* Bg Repeat */
                        $options = array('no-repeat', 'repeat', 'repeat-x', 'repeat-y');
                        ?>
							<br>
							<p><?php 
                        _e('Background repeat', 'wolf');
                        ?>
</p>
							<select name="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_repeat';
                        ?>
]" id="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_repeat';
                        ?>
]">
								<?php 
                        foreach ($options as $o) {
                            ?>
									<option value="<?php 
                            echo esc_attr($o);
                            ?>
" <?php 
                            selected($cat_meta_value[$field_id . '_repeat'], $o);
                            ?>
><?php 
                            echo esc_attr($o);
                            ?>
</option>
								<?php 
                        }
                        ?>
							</select>
							<?php 
                    }
                    if (!in_array('position', $exclude_params)) {
                        /* Bg position */
                        $options = array('center center', 'center top', 'left top', 'right top', 'center bottom', 'left bottom', 'right bottom', 'left center', 'right center');
                        ?>
						<br><br>
						<p><?php 
                        _e('Background position', 'wolf');
                        ?>
</p>
						<select name="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_position';
                        ?>
]" id="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_position';
                        ?>
]">
							<?php 
                        foreach ($options as $o) {
                            ?>
								<option value="<?php 
                            echo esc_attr($o);
                            ?>
" <?php 
                            selected($cat_meta_value[$field_id . '_position'], $o);
                            ?>
><?php 
                            echo esc_attr($o);
                            ?>
</option>
							<?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                    if (!in_array('size', $exclude_params)) {
                        /* size
                        			--------------------*/
                        $options = array('cover' => __('cover (resize)', 'wolf'), 'normal' => __('normal', 'wolf'), 'resize' => __('responsive (hard resize)', 'wolf'));
                        ?>
						<br><br>
						<p><?php 
                        _e('Background size', 'wolf');
                        ?>
</p>
						<select name="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_size';
                        ?>
]" id="wolf_post_category_meta[<?php 
                        echo sanitize_title($field_id) . '_size';
                        ?>
]">
							<?php 
                        foreach ($options as $k => $v) {
                            ?>
								<option value="<?php 
                            echo esc_attr($k);
                            ?>
" <?php 
                            selected($cat_meta_value[$field_id . '_size'], $k);
                            ?>
><?php 
                            echo sanitize_text_field($v);
                            ?>
</option>
							<?php 
                        }
                        ?>
						</select>
						<?php 
                    }
                } elseif ('video' == $type) {
                    $mp4 = $cat_meta_value[$field_id . '_mp4'];
                    $webm = $cat_meta_value[$field_id . '_webm'];
                    $ogv = $cat_meta_value[$field_id . '_ogv'];
                    $img_id = $cat_meta_value[$field_id . '_img'];
                    $img = esc_url(wolf_get_url_from_attachment_id($img_id, 'thumbnail'));
                    ?>
						<div>
							<p><strong><?php 
                    _e('mp4 URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_mp4';
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_mp4';
                    ?>
]" value="<?php 
                    echo esc_url($mp4);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
							<p><strong><?php 
                    _e('webm URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_webm';
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_webm';
                    ?>
]" value="<?php 
                    echo esc_url($webm);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
							<p><strong><?php 
                    _e('ogv URL', 'wolf');
                    ?>
</strong></p>
							<input type="text"  name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_ogv';
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_ogv';
                    ?>
]" value="<?php 
                    echo esc_url($ogv);
                    ?>
">
							<br><a href="#" class="button wolf-options-reset-file"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
							<a href="#" class="button wolf-options-set-file"><?php 
                    _e('Choose a file', 'wolf');
                    ?>
</a>
							<br><br>
						</div>

						<div>
						<p><strong><?php 
                    _e('Video Image Fallback', 'wolf');
                    ?>
</strong></p>
						<input type="hidden"  name="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_img';
                    ?>
]" id="wolf_post_category_meta[<?php 
                    echo sanitize_title($field_id) . '_img';
                    ?>
]" value="<?php 
                    echo absint($img_id);
                    ?>
">
						<img style="max-width:200px;<?php 
                    echo !$img ? 'display:none;' : '';
                    ?>
" src="<?php 
                    echo esc_url($img);
                    ?>
" class="wolf-options-img-preview">
						<br><a href="#" class="button wolf-options-reset-img"><?php 
                    _e('Clear', 'wolf');
                    ?>
</a>
						<a href="#" class="button wolf-options-set-img"><?php 
                    _e('Choose an image', 'wolf');
                    ?>
</a>
						</div>
						<?php 
                } elseif ('select' == $type) {
                    echo '<select name="' . $options_array_name . '[' . $field_id . ']' . '"  id="' . $options_array_name . '[' . $field_id . ']' . '">';
                    if (array_keys($field['options']) != array_keys(array_keys($field['options']))) {
                        foreach ($field['options'] as $k => $v) {
                            echo '<option ' . selected($cat_meta_value[$field_id], $k, false) . ' value="' . $k . '">' . $v . '</option>';
                        }
                    } else {
                        foreach ($field['options'] as $option) {
                            echo '<option ' . selected($cat_meta_value[$field_id], $option, false) . ' value="' . $k . '">' . $option . '</option>';
                        }
                    }
                    echo '</select>';
                }
                if ($desc) {
                    echo "<p class='description'>{$desc}</p>";
                }
                echo '</td></tr>';
            }
        }