コード例 #1
0
<?php 
wp_head();
?>
</head>
<?php 
if (is_blog()) {
    global $blog_page_id;
    global $post;
    $blog_page_id = wt_get_option('blog', 'blog_page');
    $post->ID = get_object_id($blog_page_id, 'page');
}
/* Sidebar Alignement  */
require_once THEME_FILES . '/layout.php';
if (!is_search()) {
    $type = get_post_meta($post->ID, '_intro_type', true);
    $bg = wt_check_input(get_post_meta($post->ID, '_page_bg', true));
    $bg_position = get_post_meta($post->ID, '_page_position_x', true);
    $bg_repeat = get_post_meta($post->ID, '_page_repeat', true);
    $color = get_post_meta($post->ID, '_page_bg_color', true);
} else {
    $type = 'default';
}
$stickyHeader = wt_get_option('general', 'sticky_header');
$noStickyOnSS = wt_get_option('general', 'no_sticky_on_ss');
$retinaLogo = wt_get_option('general', 'logo_retina');
$retinaLogoAlt = wt_get_option('general', 'logo_retina_alt');
$enable_retina = wt_get_option('general', 'enable_retina');
$animations = wt_get_option('general', 'enable_animation');
$pageLoader = wt_get_option('general', 'page_loader');
$responsiveNav = wt_get_option('general', 'responsive_nav');
$menu_type = 'top';
コード例 #2
0
    function wt_staticVideo($type)
    {
        global $post;
        if ($type == 'static_video') {
            if (get_post_meta($post->ID, '_featured_video', true)) {
                $featured_video = wt_check_input(get_post_meta($post->ID, '_featured_video', true));
            }
        }
        ?>
	<header id="wt_intro">
		<div class="container">
        	<div class="intro_staticVideo">
				<?php 
        echo wt_video_featured($wt_video_featured, '', '', 720, 1280);
        ?>
			</div>
		</div>
	</header>
<?php 
    }
コード例 #3
0
    /**
     * displays Cycle Slider
     */
    function wt_cycle_custom_slider($get_options)
    {
        $button = isset($get_options['button']) ? $get_options['button'] : 'Insert Image';
        $removebutton = isset($get_options['button']) ? $get_options['button'] : 'Remove Image';
        $desc = isset($get_options['desc']) ? $get_options['desc'] : 'Enter URL';
        echo '<tr><td>';
        echo '<div class="slideImages">';
        $get_options = get_option(THEME_SLUG . '_' . 'slideshow');
        if (!$get_options['cycle_custom_slider_count'] || $get_options['cycle_custom_slider_count'] < 0) {
            $get_options['cycle_custom_slider_count'] = 1;
        }
        ?>
        <div id="toggle_click" class="multitables cycle selected_custom">
		<input name="cycle_custom_slider_count" id="cycle_custom_slider_count" class="slider_counter count_hide_rm" type="hidden" value="<?php 
        echo $get_options['cycle_custom_slider_count'];
        ?>
" />
        
		<table class="widefat table_sort">
		<thead>
            <tr>
                <th width="60px">Reorder</th>
                <th width="60px">Delete</th>
                <th width="500px">Settings</th>
                <th class="thumbnail">Thumbnail</th>
            </tr>
		</thead>
		<tfoot>
            <tr>
                <th>&nbsp;</th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
		</tfoot>
		
		<tbody>
        <?php 
        $cycle_count = $get_options['cycle_custom_slider_count'] + 1;
        ?>
                     
        <?php 
        for ($z = 0; $z < $cycle_count; $z++) {
            echo ' <tr class="multitable';
            if ($z + 1 == $cycle_count) {
                echo ' hidden clone_row';
            }
            echo '">
			<td class="slider_drag">
				 <span class="changenumber">';
            echo $z + 1;
            $target = 'cycle_custom_slider_url_' . $z;
            echo '</span>
			</td>
			<td>';
            ?>
	
            	<a href="#" title="Delete Row" class="del_row" >
					<img src="<?php 
            echo THEME_ADMIN_ASSETS_URI;
            ?>
/images/close_button.gif"  alt="Delete Row" />
                </a>
			</td>
			<td>                    
                <div class="formField">
                    <p class="description"><?php 
            echo $desc;
            ?>
</p>
                    <input class="correct_num upload-value" id="cycle_custom_slider_url_<?php 
            echo $z;
            ?>
" name="cycle_custom_slider_url_<?php 
            echo $z;
            ?>
" type="text" value="<?php 
            if (!empty($get_options['cycle_custom_slider_url_' . $z])) {
                echo wt_check_input($get_options['cycle_custom_slider_url_' . $z]);
            }
            ?>
" size="50" />                
                    <?php 
            global $wp_version;
            if (version_compare($wp_version, "3.5", '<')) {
                ?>
						<div class="theme-upload-buttons"><a class="upload_number thickbox button button-primary theme-upload-button" id="cycle_custom_slider_url_<?php 
                echo $z . '_button';
                ?>
" href="media-upload.php?&target=cycle_custom_slider_url_<?php 
                echo $z;
                ?>
&option_image_upload=1&type=image&TB_iframe=1&width=640&height=529"><?php 
                echo $button;
                ?>
</a>
                   
                    <a class="upload_number button-secondary theme-upload-media-button theme-upload-remove" id="cycle_custom_slider_url_<?php 
                echo $z . '_remove';
                ?>
"><?php 
                echo $removebutton;
                ?>
</a>
                </div>
					<?php 
            } else {
                ?>
                  
                    <div class="theme-upload-buttons"><a href="#" class="upload_number button theme-upload-button button-primary" id="cycle_custom_slider_url_<?php 
                echo $z . '_button';
                ?>
" data-target="cycle_custom_slider_url_<?php 
                echo $z;
                ?>
" data-uploader_title="<?php 
                echo $button;
                ?>
" data-uploader_button_text="<?php 
                echo $button;
                ?>
"><?php 
                echo $button;
                ?>
</a>
                    
                    <a class="upload_number button-secondary theme-upload-media-button theme-upload-remove" id="cycle_custom_slider_url_<?php 
                echo $z . '_remove';
                ?>
"><?php 
                echo $removebutton;
                ?>
</a>
                </div>
						
					<?php 
            }
            ?>
                </div>
                <div class="formField">
                    <p class="description">Slider Url ( If YouTube: e.g http://www.youtube.com/v/f7AU2Ozu8eo )</p>
                    <input class="correct_num" id="cycle_custom_slider_link_<?php 
            echo $z;
            ?>
" name="cycle_custom_slider_link_<?php 
            echo $z;
            ?>
" type="text" value="<?php 
            if (!empty($get_options['cycle_custom_slider_url_' . $z])) {
                echo wt_check_input($get_options['cycle_custom_slider_link_' . $z]);
            }
            ?>
" size="50"/>
                </div> 
                                       
                <div class="formField">
                	<?php 
            $selected_opt = '';
            if (isset($get_options['custom_slider_cycle_type_' . $z])) {
                switch ($get_options['custom_slider_cycle_type_' . $z]) {
                    case 'html':
                        $selected_opt = 'Slide item html';
                        break;
                    case 'youtube':
                        $selected_opt = 'Slide YouTube';
                        break;
                    case 'image':
                    default:
                        $selected_opt = 'Slide item with image';
                }
            }
            ?>
                    <p class="description">Slide Item Type</p>
                    <span class="wt_select_wrapp">
                    <select class="correct_num" id="custom_slider_cycle_type_<?php 
            echo $z;
            ?>
" name="custom_slider_cycle_type_<?php 
            echo $z;
            ?>
" >
                        <option id="custom_slider_cycle_image_<?php 
            echo $z;
            ?>
" value="image" <?php 
            if (isset($get_options['custom_slider_cycle_type_' . $z]) && $get_options['custom_slider_cycle_type_' . $z] == "image") {
                echo "selected='selected'";
            }
            ?>
>Slide item with image</option>
                        <option id="custom_slider_cycle_html_<?php 
            echo $z;
            ?>
" value="html" <?php 
            if (isset($get_options['custom_slider_cycle_type_' . $z]) && $get_options['custom_slider_cycle_type_' . $z] == "html") {
                echo "selected='selected'";
            }
            ?>
>Slide item html</option>
                        <option id="custom_slider_cycle_youtube_<?php 
            echo $z;
            ?>
" value="youtube" <?php 
            if (isset($get_options['custom_slider_cycle_type_' . $z]) && $get_options['custom_slider_cycle_type_' . $z] == "youtube") {
                echo "selected='selected'";
            }
            ?>
>Slide YouTube</option>
                    </select> 
			        <span class="wt_option_selected"><?php 
            echo $selected_opt;
            ?>
</span> 
                    </span>                                                          
                </div> 
                
                <div class="formField cycle_options custom_slider_cycle_image_caption_<?php 
            echo $z;
            ?>
">
                    <p class="description">Cycle Slider Caption</p>
                    <textarea class="correct_num" id="custom_slider_cycle_image_caption_<?php 
            echo $z;
            ?>
" name="custom_slider_cycle_image_caption_<?php 
            echo $z;
            ?>
" rows="5"><?php 
            if (!empty($get_options['cycle_custom_slider_url_' . $z])) {
                echo stripslashes($get_options['custom_slider_cycle_image_caption_' . $z]);
            }
            ?>
</textarea>
                </div>  
                                  
                <div class="formField cycle_options custom_slider_cycle_html_text_<?php 
            echo $z;
            ?>
">
                    <p class="description">Cycle Slider HTML</p>
                    <textarea class="correct_num" id="custom_slider_cycle_html_text_<?php 
            echo $z;
            ?>
" name="custom_slider_cycle_html_text_<?php 
            echo $z;
            ?>
" rows="5"><?php 
            if (!empty($get_options['cycle_custom_slider_url_' . $z])) {
                echo stripslashes($get_options['custom_slider_cycle_html_text_' . $z]);
            }
            ?>
</textarea>
                </div> 
                                        
                <div class="formField cycle_options custom_slider_cycle_color_<?php 
            echo $z;
            ?>
 padTop10">
                    <p class="description inlineStyle">Slide Item Color</p>.
                        <a class="more_info" href="">[+] more info</a>
                        <p class="more_info"><em>Here you can specify a background color below for the slide item. Set transparent to disable this</em></p>
                    <div class="color-input-wrap">
                        <input id="custom_slider_cycle_color_<?php 
            echo $z;
            ?>
" name="custom_slider_cycle_color_<?php 
            echo $z;
            ?>
" class="correct_num colorinput" type="text" value="<?php 
            if (!empty($get_options['custom_slider_cycle_color_' . $z])) {
                echo wt_check_input($get_options['custom_slider_cycle_color_' . $z]);
            }
            ?>
" data-hex="true">
                    </div>                        
                </div>                         
                                           
                <script>
                    jQuery(document).ready(function () {
                        
                        var $slider_type = jQuery("#custom_slider_cycle_type_<?php 
            echo $z;
            ?>
").val(); 
                        var $slider_caption = jQuery(".custom_slider_cycle_image_caption_<?php 
            echo $z;
            ?>
");
                        var $slider_html = jQuery(".custom_slider_cycle_html_text_<?php 
            echo $z;
            ?>
");
                        var $slider_html_color = jQuery(".custom_slider_cycle_color_<?php 
            echo $z;
            ?>
");
                        
                        if ($slider_type == "html") {	
                            $slider_html.show();
                            $slider_html_color.show();
                        } 
						if ($slider_type == "image") { 
                            $slider_caption.show();
                        }
                                                                                        
                        jQuery("#custom_slider_cycle_type_<?php 
            echo $z;
            ?>
").change(function () {
							var type = jQuery(this).val();
                            switch(type) {
                                case "image":
                                    $slider_caption.show();
                                    $slider_html.hide();
                            		$slider_html_color.hide();
                                    break;
                                case "html":
                                    $slider_caption.hide();
                                    $slider_html.show();
                            		$slider_html_color.show();
                                    break;									
                                default:
                                    $slider_caption.hide();
                                    $slider_html.hide();
                            		$slider_html_color.hide();																			
                            }
                        })
                    });
                </script>
			</td>
			<td>  
                <div id="cycle_custom_slider_url_<?php 
            echo $z;
            ?>
_preview" class="theme-option-image-preview">       
                <?php 
            if (!empty($get_options['cycle_custom_slider_url_' . $z])) {
                // echo '<a class="thickbox" href="' . $get_options['custom_slider_url_'.$z] . '" target="_blank"><img src="' . $get_options['custom_slider_url_'.$z] . '"/></a>';
                $filename = substr($get_options['cycle_custom_slider_url_' . $z], 0, strrpos($get_options['cycle_custom_slider_url_' . $z], '.'));
                $extension = substr($get_options['cycle_custom_slider_url_' . $z], strrpos($get_options['cycle_custom_slider_url_' . $z], '.') + 1);
                echo '<a class="thickbox" href="' . $get_options['cycle_custom_slider_url_' . $z] . '" target="_blank"><img src="' . $filename . '-150x150.' . $extension . '"/></a>';
            }
            ?>
                </div>
		<?php 
        }
        ?>
			</td>		
            
		</tbody>			
		</table>
        <p class="lower_button"><input type="submit" class="button-primary apply add_row" value="Add New Slide" /></p>
		</div>
        </td></tr>
<?php 
    }
コード例 #4
0
 /**
  * displays a color input
  */
 function wt_color($value)
 {
     $size = isset($value['size']) ? $value['size'] : '10';
     echo '<div class="meta-box-item">';
     echo '<div class="meta-box-item-title"><h4>' . $value['name'] . '</h4>';
     if (isset($value['desc'])) {
         echo '<a class="switch" href="">[+] more info</a></div><p class="description">' . $value['desc'] . '</p>';
     } else {
         echo '</div>';
     }
     $val = wt_check_input($value['default']);
     if (empty($val)) {
         $transparent = true;
     } else {
         $transparent = false;
     }
     echo '<div class="meta-box-item-content">';
     echo '<div class="color-input-wrap"><input' . (isset($value['class']) ? ' class="' . $value['class'] . '"' : '') . ' name="' . $value['id'] . '" id="' . $value['id'] . '" type="text" ' . ($transparent ? 'data-transparent="true" ' : '') . 'data-hex="true" size="' . $size . '" value="' . $val . '" /></div>';
     echo '<br /></div>';
     echo '</div>';
 }