コード例 #1
0
 public function setSections()
 {
     //---- Theme Option Here ----//
     $schedules = array();
     $wp_get_schedules = function_exists('wp_get_schedules') ? wp_get_schedules() : null;
     if (is_array($wp_get_schedules) && !empty($wp_get_schedules)) {
         foreach ($wp_get_schedules as $key => $value) {
             $schedules[$key] = $value['display'];
         }
     }
     // General settings
     $this->sections[] = array('title' => __('General', 'gazeta'), 'icon' => 'el-icon-website', 'desc' => null, 'fields' => array(array('id' => 'favicon', 'type' => 'media', 'url' => true, 'preview' => false, 'subtitle' => __('Upload any media using the WordPress native uploader', 'gazeta'), 'title' => __('Favicon', 'gazeta')), array('id' => 'sidebar', 'type' => 'image_select', 'title' => __('Blog Layout', 'gazeta'), 'options' => array('left-sidebar' => array('alt' => __('Left Sidebar', 'gazeta'), 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'), 'right-sidebar' => array('alt' => __('Right Sidebar', 'gazeta'), 'img' => ReduxFramework::$_url . 'assets/img/2cr.png')), 'default' => 'right-sidebar', 'description' => __('Set the layout of the blog/category/archive/author/tag/search page, not for static page.', 'gazeta')), array('id' => 'transient', 'type' => 'checkbox', 'title' => __('Enable Transient', 'gazeta'), 'description' => __('Caching the Widget/Shortcode', 'gazeta'), 'default' => '0'), array('id' => 'transient_expiration', 'type' => 'text', 'title' => __('Transient Expiration', 'gazeta'), 'subtitle' => __('Set/update the expiration value of the transients.', 'gazeta'), 'validate' => 'numeric', 'description' => __('Time until expiration in seconds from now, or 0 for never expires. Ex: For one day, the expiration value would be: (60 * 60 * 24), all widgets and shortcodes will be cached with expiration is 300 seconds (mean is 5 minutes), you can set this value in the widget or the shortcode with the various values, example: <strong>[shortcode expiration="600"]</strong> or enter a general value in this option, this will effect to all Widgets and Shortcodes.', 'gazeta'), 'required' => array('transient', "=", '1')), array('id' => '404-page', 'type' => 'select', 'data' => 'pages', 'title' => __('404 Page', 'gazeta'), 'subtitle' => __('Choose the 404 Error Page.', 'gazeta'), 'description' => __('Or leave blank for default.', 'gazeta')), array('id' => 'viewing', 'type' => 'switch', 'title' => __('Viewing', 'gazeta'), 'subtitle' => __('Activating Post Viewing feature.', 'gazeta'), 'description' => __('On/Off will display/hide the View count number, this feature require Jetpack\'s Stats feature activated.', 'gazeta'), 'default' => 1), array('id' => 'custom_css', 'type' => 'ace_editor', 'title' => __('Custom CSS', 'gazeta'), 'subtitle' => __('Paste your CSS code here, no style tag.', 'gazeta'), 'mode' => 'css', 'theme' => 'monokai'), array('id' => 'custom_css_mobile', 'type' => 'ace_editor', 'title' => __('Mobile Custom CSS', 'gazeta'), 'subtitle' => __('Paste your CSS code here, no style tag, this CSS will effect to the site on Mobile.', 'gazeta'), 'mode' => 'css', 'theme' => 'monokai'), array('id' => 'custom_js', 'type' => 'ace_editor', 'title' => __('Custom JS', 'gazeta'), 'subtitle' => __('Paste your JS code here, no script tag, eg: alert(\'hello world\');', 'gazeta'), 'mode' => 'javascript', 'theme' => 'chrome'), array('id' => 'custom_js_mobile', 'type' => 'ace_editor', 'title' => __('Mobile Custom JS', 'gazeta'), 'subtitle' => __('Paste your JS code here, no script tag, this JS will effect to the site on Mobile eg: alert(\'hello world\');', 'gazeta'), 'mode' => 'javascript', 'theme' => 'chrome')));
     // Styling.
     $this->sections[] = array('title' => __('Styling', 'gazeta'), 'icon' => 'el-icon-th-list', 'desc' => null, 'fields' => array(array('id' => 'body', 'type' => 'typography', 'title' => __('Body', 'gazeta'), 'font-size' => false, 'color' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('body'), 'compiler' => array('body'), 'units' => 'px', 'default' => array('font-family' => 'Raleway', 'google' => true)), array('id' => 'menu', 'type' => 'typography', 'title' => __('Menu Item', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('header nav ul li a'), 'compiler' => array('header nav ul li a'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading', 'type' => 'typography', 'title' => __('Heading', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h1,h2,h3,h4,h5,h6'), 'compiler' => array('h1,h2,h3,h4,h5,h6'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading1', 'type' => 'typography', 'title' => __('Heading 1', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h1'), 'compiler' => array('h1'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading2', 'type' => 'typography', 'title' => __('Heading 2', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h2'), 'compiler' => array('h2'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading3', 'type' => 'typography', 'title' => __('Heading 3', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h3'), 'compiler' => array('h3'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading4', 'type' => 'typography', 'title' => __('Heading 4', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h4'), 'compiler' => array('h4'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading5', 'type' => 'typography', 'title' => __('Heading 5', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h5'), 'compiler' => array('h5'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading6', 'type' => 'typography', 'title' => __('Heading 6', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h6'), 'compiler' => array('h6'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'entry-title', 'type' => 'typography', 'title' => __('Entry Title', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('.entry-title, .entry-title a, .post-title a'), 'compiler' => array('.entry-title, .entry-title a, .post-title a'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'entry-content', 'type' => 'typography', 'title' => __('Entry Content', 'gazeta'), 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('div.entry-content p, p.entry-content'), 'compiler' => array('div.entry-content p, p.entry-content'), 'units' => 'px', 'default' => array('font-family' => 'Arial', 'google' => true)), array('id' => 'widget-heading-font', 'type' => 'typography', 'title' => __('Widget Heading Font', 'gazeta'), 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('.side-widget h5 span'), 'compiler' => array('.side-widget h5 span'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'widget_heading_wrapper_bg', 'type' => 'background', 'output' => array('.side-widget h5'), 'title' => __('Widget Wrapper Background', 'saturn'), 'subtitle' => __('Pick a background color for the Widget Heading.', 'saturn'), 'background-repeat' => false, 'background-attachment' => false, 'background-position' => false, 'background-image' => false, 'background-size' => false), array('id' => 'widget_heading_inner_bg', 'type' => 'background', 'output' => array('.side-widget h5 span'), 'title' => __('Widget Inner Background', 'saturn'), 'subtitle' => __('Pick a background color for the Widget Heading.', 'saturn'), 'background-repeat' => false, 'background-attachment' => false, 'background-position' => false, 'background-image' => false, 'background-size' => false), array('id' => 'widget_heading_color', 'type' => 'color', 'output' => array('.side-widget h5 span'), 'title' => __('Widget Heading Color', 'saturn'), 'subtitle' => __('Pick a color for the Widget Heading (default: #fff).', 'saturn'), 'validate' => 'color')));
     $header_field = array();
     $header_field[] = array('id' => 'top_bar', 'type' => 'checkbox', 'title' => __('Shows the Top Bar', 'gazeta'), 'default' => '1');
     $header_field[] = array('id' => 'header_current_time', 'type' => 'checkbox', 'title' => __('Current Datetime', 'gazeta'), 'subtitle' => __('Display current datetime', 'gazeta'), 'default' => '1');
     $header_field[] = array('id' => 'header_current_time_format', 'type' => 'text', 'title' => __('Datetime Format', 'gazeta'), 'subtitle' => __('Formatting Date and Time', 'gazeta'), 'description' => sprintf(__('Check <strong>%s</strong> for more info.', 'gazeta'), '<a href="http://codex.wordpress.org/Formatting_Date_and_Time">' . __('HERE', 'gazeta') . '</a>'), 'default' => 'l, F j, Y');
     $header_field[] = array('id' => 'header_weather', 'type' => 'checkbox', 'title' => __('Weather', 'gazeta'), 'subtitle' => __('Display the Weather Informations', 'gazeta'), 'default' => '0');
     $header_field[] = array('id' => 'header_weather_apikey', 'type' => 'text', 'title' => __('Wunderground API Key', 'gazeta'), 'subtitle' => __('A paid service of Wunderground.com', 'gazeta'), 'description' => sprintf(__('This Key can be found at %s, You would need to signup and register a key, <i>This featured may not work properly for some locations.</i>', 'gazeta'), '<a href="http://www.wunderground.com/weather/api/">' . __('HERE', 'gazeta') . '</a>'), 'required' => array('header_weather', "=", '1'));
     $header_field[] = array('id' => 'header_weather_location', 'type' => 'text', 'title' => __('Location', 'gazeta'), 'subtitle' => __('Getting this location\'s weather information', 'gazeta'), 'description' => sprintf(__('Or leave blank for getting visitor\'s location, the location is based on the IP address, here is %s', 'gazeta'), '<a target="_blank" href="http://ipinfo.io/">' . __('yours', 'gazeta') . '</a>'), 'required' => array('header_weather', "=", '1'));
     $header_field[] = array('id' => 'header_weather_expiration', 'type' => 'text', 'title' => __('Transient Expiration', 'gazeta'), 'subtitle' => __('Set/update the expiration value of the transients.', 'gazeta'), 'default' => 1200, 'required' => array('header_weather', "=", '1'));
     $socials_field = function_exists('gazeta_user_contactmethods') ? gazeta_user_contactmethods(array()) : '';
     if (is_array($socials_field)) {
         foreach ($socials_field as $key => $value) {
             $header_field[] = array('id' => 'header_social_' . $key, 'type' => 'text', 'title' => $value, 'subtitle' => sprintf(__('%s Profile Url', 'gazeta'), $value));
         }
     }
     // Header.
     $this->sections[] = array('title' => __('Header', 'gazeta'), 'icon' => 'el-icon-wrench', 'desc' => null, 'fields' => apply_filters('gazeta_theme_options/header_field_args', $header_field));
     // Footer.
     $this->sections[] = array('title' => __('Footer', 'gazeta'), 'icon' => 'el-icon-wrench', 'desc' => null, 'fields' => array(array('id' => 'footer-columns', 'type' => 'text', 'title' => __('Footer\'s Columns', 'gazeta'), 'subtitle' => __('Setting the Footer\'s widget columns.', 'gazeta'), 'validate' => 'numeric', 'default' => '4'), array('id' => 'credits', 'type' => 'textarea', 'title' => __('Footer Text', 'gazeta'), 'subtitle' => __('HTML Allowed', 'gazeta'), 'validate' => 'html', 'default' => sprintf(__('Copyright &copy; 2014 %s', 'gazeta'), get_bloginfo('name')))));
 }
コード例 #2
0
ファイル: header.php プロジェクト: alvarpoon/get-it-write
				<?php 
    if (gazeta_get_the_weather(apply_filters("the_weather", "c"))) {
        ?>
					<li class="tbl-temp"><i class="fa fa-sun-o"></i><?php 
        print gazeta_get_the_weather(apply_filters("the_weather", "c"));
        ?>
</li>
				<?php 
    }
    ?>
			</ul>
		</div>
		<div class="col-md-6">
			<ul class="tb-right">
				<?php 
    $socials_field = function_exists('gazeta_user_contactmethods') ? gazeta_user_contactmethods(array()) : '';
    if (is_array($socials_field) && !empty($socials_field)) {
        ?>
			
					<li class="tbr-social">
						<span>
							<?php 
        foreach ($socials_field as $key => $value) {
            ?>
								<?php 
            if (isset($gazeta_global_data['header_social_' . $key]) && !empty($gazeta_global_data['header_social_' . $key])) {
                ?>
									<a href="<?php 
                print esc_url($gazeta_global_data['header_social_' . $key]);
                ?>
" class="fa fa-<?php