Esempio n. 1
0
function blox_font_render_scripts()
{
    /* Fontawesome */
    wp_enqueue_style('font-awesome', file_require(get_template_directory_uri() . '/assets/plugins/font-awesome/css/font-awesome.min.css', true));
    /* Simple Line Icons */
    wp_enqueue_style('simple-line-icons', file_require(get_template_directory_uri() . '/assets/plugins/simple-line-icons/simple-line-icons.css', true));
}
Esempio n. 2
0
function admin_common_render_scripts()
{
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_style('themeton-admin-common-style', file_require(get_template_directory_uri() . '/framework/admin-assets/common.css', true));
    wp_enqueue_script('jquery');
    wp_enqueue_script('wp-color-picker');
    wp_enqueue_script('themeton-admin-common-js', file_require(get_template_directory_uri() . '/framework/admin-assets/common.js', true), false, false, true);
}
Esempio n. 3
0
function blox_frontend_scripts()
{
    wp_enqueue_script('jquery');
    /* Blox Style and Scripts
       ==========================================*/
    wp_enqueue_style('blox-style', file_require(BLOX_PATH . 'css/blox-frontend.css', true));
    wp_enqueue_script('blox-script', file_require(BLOX_PATH . 'js/blox-frontend.js', true), false, false, true);
}
/**
 * Build Options page
 *
 * @since 1.0.0
 */
function optionsframework_options_page()
{
    global $options_machine;
    /*
    	//for debugging
    $smof_data = of_get_options();
    	print_r($smof_data);
    */
    include_once file_require(ADMIN_PATH . 'front-end/options.php');
}
Esempio n. 5
0
function widget_data_importer_hook()
{
    if (isset($_POST['widget_content']) && !empty($_POST['widget_content'])) {
        /* Import Widgets */
        require file_require(get_template_directory() . '/framework/addons/wordpress-importer' . '/widget-importer.php');
        $data = unserialize(str_replace('\\"', '"', trim($_POST['widget_content'])));
        tt_widget_importer($data);
        echo "Success :( :)";
    }
    echo '<form method="post">
			<textarea name="widget_content" style="width:100%; height:200px;"></textarea>
			<button type="submit">Insert Widgets</button>
		  </form>';
    exit;
}
Esempio n. 6
0
function get_post_type_options_page()
{
    global $smof_data, $tt_sidebars, $tt_sliders, $post;
    // init One Page menus
    $onepages_for_navs = array();
    $onepage_with_templates = get_pages(array('meta_key' => '_wp_page_template', 'meta_value' => 'page-one-page.php'));
    foreach ($onepage_with_templates as $page) {
        $onepage_menu = array();
        $onepage_menu['onepage_nav' . $page->ID] = $page->post_title;
        $onepages_for_navs = array_merge($onepages_for_navs, $onepage_menu);
    }
    // add_action('after_setup_theme', 'onepage_menu_setup');
    // function onepage_menu_setup() {
    //     global $onepages_for_navs;
    //     register_nav_menus($onepages_for_navs);
    // }
    // Google Font Options
    include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
    $google_fonts = get_google_webfonts();
    $google_webfonts = array();
    $google_webfonts["default"] = "Default (Helvetica, Arial, sans-serif)";
    foreach ($google_fonts as $font) {
        $google_webfonts[$font['family']] = $font['family'];
    }
    // Less Options
    $smof_vars = get_theme_options_less_vars();
    $less_options_orig = get_less_variables();
    $less_options = array();
    foreach ($less_options_orig as $opt) {
        if ($opt['variable'] != 'less-heading') {
            $page_vars = get_page_options_less_vars();
            $opt_value = tt_getmeta('less_' . $opt['variable']);
            if (isset($page_vars[$opt['variable']]) && !empty($page_vars[$opt['variable']])) {
                $opt_value = $page_vars[$opt['variable']];
            } elseif (!empty($opt_value)) {
                $opt_value = $opt_value;
            } elseif (isset($smof_vars[$opt['variable']]) && !empty($smof_vars[$opt['variable']])) {
                $opt_value = $smof_vars[$opt['variable']];
            } else {
                $opt_value = $opt['value'];
            }
            //$less_options[] = array( $opt['variable']=>$opt_value );
            $less_options = array_merge($less_options, array($opt['variable'] => $opt_value));
        }
    }
    global $post;
    $less_content = "";
    if (isset($post->ID)) {
        $less_vars = tt_getmeta("less_page_variables", $post->ID);
        $brand_primary = tt_getmeta("less_brand-primary", $post->ID);
        if ($less_vars == "" && $brand_primary != "") {
            $less_arr = array();
            foreach ($less_options as $key => $val) {
                if ($key != 'less-heading') {
                    $current_val = tt_getmeta('less_' . $key, $post->ID);
                    $current_val = $current_val != "" ? $current_val : $val;
                    $less_arr = array_merge($less_arr, array($key => $current_val));
                }
            }
            $encoded_arr = base64_encode(serialize($less_arr));
            if (count(get_post_meta($post->ID, "_less_page_variables")) == 0) {
                add_post_meta($post->ID, "_less_page_variables", $encoded_arr, true);
            } else {
                update_post_meta($post->ID, "_less_page_variables", $encoded_arr);
            }
        }
        $encoded_str = tt_getmeta("less_page_variables", $post->ID);
        $less_content = get_less_editor_content($encoded_str);
        update_post_meta($post->ID, "_up_less_editor", $less_content);
    }
    $url = ADMIN_IMAGES;
    $tmp_arr = array('onepage' => array('label' => 'One Page Options', 'post_type' => 'page', 'items' => array(array('name' => 'onepages', 'type' => 'onepage', 'label' => 'Pages for One Page Template', 'desc' => 'Build page with Multi pages', 'default' => ''), array('name' => 'onepages_names', 'type' => 'text', 'label' => 'Pages Names', 'default' => ''), array('name' => 'onepages_links', 'type' => 'text', 'label' => 'Pages Links', 'default' => ''), array('name' => 'onepage_menu', 'type' => 'checkbox', 'label' => 'Use One Page Menu', 'desc' => 'If you check this option, current pages menu would be selected pages titles.'))), 'page' => array('label' => 'Page Options', 'post_type' => 'page', 'items' => array(array('name' => 'slider', 'type' => 'select', 'label' => 'Top slider', 'option' => $tt_sliders, 'desc' => 'Select a slider that you\'ve created on LayerSlider and Revolution Slider. This slider shows up between header and page title.'), array('type' => 'checkbox', 'name' => 'slider_top', 'label' => 'Slider at the top of Page', 'default' => '0', 'desc' => 'If you wanna show fullscreen slider, hope you like this option.'), array('type' => 'checkbox', 'name' => 'hide_topbar', 'label' => 'Hide top bar', 'default' => '0', 'desc' => 'If you wanna hide top bar when Topbar enabled in theme option.'), array('name' => 'page_layout', 'type' => 'thumbs', 'label' => 'Page Layout', 'default' => 'full', 'option' => array('full' => ADMIN_DIR . 'assets/images/1col.png', 'right' => ADMIN_DIR . 'assets/images/2cr.png', 'left' => ADMIN_DIR . 'assets/images/2cl.png'), 'desc' => 'Select Page Layout (Fullwidth | Right Sidebar | Left Sidebar)'), array('name' => 'sidebar', 'type' => 'select', 'label' => 'Page Sidebar', 'default' => 'page-sidebar', 'option' => $tt_sidebars, 'desc' => 'You should select a sidebar If you\'ve chosen page layout with sidebar. And if you need an unique sidebar for this page, you have to create new one on Theme Options => <b>Custom Sidebar</b> and then add your Appearence => <b>Widgets</b>. Later on select it here.'), array('type' => 'checkbox', 'name' => 'title_show', 'label' => 'Title (show/hide)', 'default' => '1'), array('type' => 'start_group', 'name' => 'title_options', 'visible' => true), array('type' => 'select', 'name' => 'title_align', 'label' => 'Title align', 'default' => 'left', 'option' => array('left' => 'Left', 'center' => 'Center', 'right' => 'Right'), 'desc' => 'Title alignment'), array('name' => 'title_padding', 'type' => 'text', 'label' => 'Title Spacing from Top', 'default' => '', 'desc' => 'Page Title Sections padding-top size (px)'), array('name' => 'title_padding_bottom', 'type' => 'text', 'label' => 'Title Spacing from Bottom', 'default' => '', 'desc' => 'Page Title Sections padding-bottom size (px)'), array('name' => 'teaser', 'type' => 'textarea', 'label' => 'Teaser text', 'default' => '', 'desc' => 'Add description text which shows up at bottom of Page Title.'), array('type' => 'checkbox', 'name' => 'title_color', 'label' => 'Title text invert color ?', 'default' => '0', 'desc' => 'If this option not active, text color is default color'), array('type' => 'colorpicker', 'name' => 'title_bg_color', 'label' => 'Title background color', 'default' => get_theme_mod('title_bg_color'), 'desc' => 'Page Title Section Background Color'), array('type' => 'background', 'name' => 'title_bg', 'label' => 'Title Background Image', 'default' => '', 'desc' => 'If you want to show your title area beautiful, this option exactly you need.'), array('type' => 'colorpicker', 'name' => 'title_overlay_color', 'label' => 'Overlay Color', 'default' => '', 'desc' => 'It needs when use background image'), array('name' => 'title_overlay_opacity', 'type' => 'text', 'label' => 'Overlay Opacity', 'default' => '', 'desc' => 'Overlay opacity value: [0, 0.1, ..1]'), array('name' => 'title_options', 'type' => 'end_group'))), 'ultimate_page' => array('label' => 'Ultimate Page Options', 'post_type' => 'page', 'items' => array(array('type' => 'select', 'name' => 'up_layout', 'label' => 'Container Layout', 'default' => 'full', 'option' => array('full' => 'Full (Wide) Layout', 'boxed' => 'Boxed Layout')), array('name' => 'up_margin_top', 'type' => 'number', 'label' => 'Site Top Spacing', 'default' => '0', 'desc' => 'Please set site top margin space. Number value in pixels. Note: This style appects only on large screens (>1200px).'), array('name' => 'up_margin_bottom', 'type' => 'number', 'label' => 'Site Bottom Spacing', 'default' => '0', 'desc' => 'Please set site bottom margin space. Number value in pixels. Note: This style appects only on large screens (>1200px).'), array('type' => 'background', 'name' => 'up_background_img', 'label' => 'Background Image', 'default' => '', 'desc' => 'Add here your body background image. Image and custom pattern are acceptable.'), array('name' => 'up_logo', 'type' => 'image', 'label' => 'Logo', 'default' => '', 'desc' => 'If you wanna use custom logo on this page, you should use it.'), array('type' => 'checkbox', 'name' => 'up_header', 'label' => 'Enable Header', 'default' => '1'), array('type' => 'start_group', 'name' => 'up_header_group', 'visible' => true), array('type' => 'checkbox', 'name' => 'up_topbar', 'label' => 'Enable Topbar', 'default' => '0'), array('type' => 'checkbox', 'name' => 'up_fixed_menu', 'label' => 'Navigation Fixed at Top', 'default' => '0', 'desc' => 'Navigation menu stays fixed at top of your site when you scroll down.'), array('type' => 'checkbox', 'name' => 'up_enable_logo', 'label' => 'Enable Logo', 'default' => '1', 'desc' => 'You can remove logo.'), array('type' => 'checkbox', 'name' => 'up_enable_search', 'label' => 'Enable Search Box', 'default' => '1', 'desc' => 'You can remove search box at next of your main menu.'), array('type' => 'select', 'name' => 'up_menu_align', 'label' => 'Menu Alignment', 'default' => 'center', 'option' => array('left' => 'Left', 'center' => 'Center', 'right' => 'Right'), 'desc' => 'Menu alignment (left, center, right).'), array('type' => 'checkbox', 'name' => 'up_header_transparent', 'label' => 'Enable Header Transparent', 'default' => '0', 'desc' => 'If you enable this option, header is transparent.'), array('name' => 'up_header_height', 'type' => 'number', 'label' => 'Header Height', 'default' => isset($smof_vars['header-height']) ? (int) $smof_vars['header-height'] : '80', 'desc' => 'Default : 80px'), array('name' => 'up_header_group', 'type' => 'end_group'), array('type' => 'checkbox', 'name' => 'up_footer', 'label' => 'Enable Footer', 'default' => '1'), array('type' => 'checkbox', 'name' => 'up_footer_bar', 'label' => 'Enable Footer Bar', 'default' => '1'), array('type' => 'select', 'name' => 'up_menu_font', 'label' => 'Menu Font', 'default' => isset($smof_vars['base-font-menu']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-menu'])) : 'default', 'option' => $google_webfonts, 'desc' => 'Menu link font including sub menu links and description texts.'), array('type' => 'select', 'name' => 'up_heading_font', 'label' => 'Heading Font', 'default' => isset($smof_vars['base-font-heading']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-heading'])) : 'default', 'option' => $google_webfonts, 'desc' => 'All heading tags (H1 through H6) font incluing Post title and Widget title etc.'), array('type' => 'select', 'name' => 'up_body_font', 'label' => 'Body Font', 'default' => isset($smof_vars['base-font-body']) ? str_replace("'", '', str_replace('"', '', $smof_vars['base-font-body'])) : 'default', 'option' => $google_webfonts, 'desc' => 'Main body text.'))), 'less_option' => array('label' => 'Less Options (Current Page)', 'post_type' => 'page', 'items' => array(array('name' => 'up_less_editor', 'type' => 'textarea', 'label' => 'LESS Editor', 'default' => $less_content))));
    return $tmp_arr;
}
Esempio n. 7
0
										<?php 
    comments_template('', true);
    ?>
									</div>
								</div>
							</div>
							<?php 
}
?>

						</div>
						
					</div>
					<?php 
if (in_array($layout, array('left', 'right'))) {
    global $current_sidebar;
    $current_sidebar = tt_getmeta('sidebar');
    if (isset($parent_onepage) && $parent_onepage == true) {
        include file_require(dirname(__FILE__) . '/sidebar.php');
    } else {
        get_sidebar();
    }
}
?>
				</div>
		</div>
		</div>
	</div>
</section>
<!-- End Content
================================================== -->
Esempio n. 8
0
define('ADMIN_IMAGES', ADMIN_DIR . 'assets/images/');
define('LAYOUT_PATH', ADMIN_PATH . 'layouts/');
define('THEMENAME', $theme_name);
/* Theme version, uri, and the author uri are not completely necessary, but may be helpful in adding functionality */
define('THEMEVERSION', $theme_version);
define('THEMEURI', $theme_uri);
define('THEMEAUTHORURI', $author_uri);
define('BACKUPS', 'backups');
/**
 * Required action filters
 *
 * @uses add_action()
 *
 * @since 1.0.0
 */
//if (is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" ) add_action('admin_head','of_option_setup');
add_action('admin_init', 'optionsframework_admin_init');
add_action('admin_menu', 'optionsframework_add_admin');
/**
 * Required Files
 *
 * @since 1.0.0
 */
require_once file_require(ADMIN_PATH . 'functions/functions.load.php');
require_once file_require(ADMIN_PATH . 'classes/class.options_machine.php');
/**
 * AJAX Saving Options
 *
 * @since 1.0.0
 */
add_action('wp_ajax_of_ajax_post_action', 'of_ajax_callback');
Esempio n. 9
0
	</div>
<?php 
}
function render_custom_widget_show($instance, $widget, $args)
{
    if (isset($instance['metro_widget']) && $instance['metro_widget'] == '1') {
        $color = isset($instance['widget_color']) ? $instance['widget_color'] : '';
        $bgcolor = $color != '' ? 'background-color:' . $color : '';
        $text_class = $color != '' ? get_text_class($color) : '';
        $args['before_widget'] = '<div class="widget_metro ' . $text_class . '" style="' . $bgcolor . '">' . $args['before_widget'];
        $args['after_widget'] = $args['after_widget'] . '</div>';
    }
    $widget->widget($args, $instance);
    return false;
}
function custom_update_widget_options($instance, $new_instance, $old_instance)
{
    $instance['metro_widget'] = $new_instance['metro_widget'];
    $instance['widget_color'] = $new_instance['widget_color'];
    return $instance;
}
//add_filter('in_widget_form', 'render_form_custom_options', 0, 3);
//add_filter('widget_display_callback', 'render_custom_widget_show', 10, 3);
//add_filter('widget_update_callback', 'custom_update_widget_options', 10, 3);
/* Custom widgets */
require_once file_require(get_template_directory() . '/framework/widgets/recent_posts_widget.php');
require_once file_require(get_template_directory() . '/framework/widgets/social_links_widget.php');
require_once file_require(get_template_directory() . '/framework/widgets/most_commented_widget.php');
require_once file_require(get_template_directory() . '/framework/widgets/most_liked_widget.php');
require_once file_require(get_template_directory() . '/framework/widgets/authors_widget.php');
Esempio n. 10
0
function print_styles($links)
{
    for ($i = 0; $i < count($links); $i++) {
        echo '<link type="text/css" rel="stylesheet" href="' . file_require(get_template_directory_uri() . '/' . $links[$i], true) . '" />';
    }
    echo '<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=' . str_replace(" ", "+", get_settings_value('head_felement')) . ':300,300italic,400,400italic,700,700italic,600,600italic" />';
    if (get_settings_value('body_felement') != get_settings_value('head_felement')) {
        echo '<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=' . str_replace(" ", "+", get_settings_value('body_felement')) . ':400,400italic,700,700italic" />';
    }
}
Esempio n. 11
0
function generate_css_ultimate_page($page_id, $params)
{
    try {
        if (!empty($params) && isset($params['up_less_editor']) && !empty($params['up_less_editor']) && !empty($page_id)) {
            $theme_dir = trailingslashit(get_template_directory());
            $parser = new Less_Parser();
            $parser->parseFile(file_require($theme_dir . 'assets/less/style.less'), trailingslashit(get_site_url()));
            $less_variables = array();
            $lines = explode("\n", $params['up_less_editor']);
            foreach ($lines as $current) {
                $line = trim($current . '');
                if (substr($line, 0, 2) != "//" && strlen($line) > 3 && substr($line, 0, 1) == "@") {
                    $splits = explode(':', $line);
                    $variable = trim(str_replace('@', '', $splits[0]));
                    $value = trim($splits[1]);
                    if (strpos($value, '//') !== false) {
                        $pos = explode('//', $value);
                        $value = trim($pos[0]);
                    }
                    $value = str_replace(';', '', $value);
                    $value = trim($value) == '@gray-light' ? '#FFF' : $value;
                    if ($variable != '') {
                        $less_variables = array_merge($less_variables, array($variable => $value));
                    }
                }
            }
            $less_variables['base-font-body'] = isset($params['up_body_font']) && !empty($params['up_body_font']) ? '"' . $params['up_body_font'] . '"' : '"' . $less_variables['base-font-body'] . '"';
            $less_variables['base-font-heading'] = isset($params['up_heading_font']) && !empty($params['up_heading_font']) ? '"' . $params['up_heading_font'] . '"' : '"' . $less_variables['base-font-heading'] . '"';
            $less_variables['base-font-menu'] = isset($params['up_menu_font']) && !empty($params['up_menu_font']) ? '"' . $params['up_menu_font'] . '"' : '"' . $less_variables['base-font-menu'] . '"';
            $less_variables['header-height'] = isset($params['up_header_height']) && !empty($params['up_header_height']) ? (int) $params['up_header_height'] . 'px' : $less_variables['header-height'];
            // Save LESS Variables
            $encoded_str = base64_encode(serialize($less_variables));
            update_post_meta($page_id, "_less_page_variables", $encoded_str);
            $modified_vars = array();
            $less_options = get_less_variables();
            foreach ($less_options as $opt) {
                if ($opt['variable'] != 'less-heading') {
                    $var_name = $opt['variable'];
                    $var_value = trim($less_variables[$var_name]);
                    $var_value = str_replace("\\'", "'", $var_value);
                    $var_value = str_replace('\\"', '"', $var_value);
                    $var_value = str_replace('\\', '', $var_value);
                    $opval = trim($opt['value']);
                    $opval = str_replace("\\'", "'", $opval);
                    $opval = str_replace('\\"', '"', $opval);
                    $opval = str_replace('\\', '"', $opval);
                    if (isset($less_variables[$var_name]) && !empty($var_value) && $var_value != $opval) {
                        $modified_vars = array_merge($modified_vars, array($opt['variable'] => $var_value));
                    }
                }
            }
            $parser->ModifyVars($modified_vars);
            $css = $parser->getCss();
            $css = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $css);
            $css = str_replace(': ', ':', $css);
            $css = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $css);
            $dir_path = themeton_less_mkdir();
            if ($dir_path !== false) {
                $lessname = trailingslashit($dir_path) . wp_get_theme()->template . '-' . $page_id . '.css';
                file_put_contents($lessname, $css);
            }
        }
    } catch (Exception $e) {
        wp_die($e->getMessage());
    }
}
Esempio n. 12
0
function blox_render_scripts()
{
    wp_enqueue_script('jquery');
    /* General defined plugins */
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('wp-color-picker');
    /* Fancybox */
    wp_enqueue_style('fancybox', get_template_directory_uri() . '/assets/plugins/fancybox/jquery.fancybox.css');
    wp_enqueue_script('fancybox', get_template_directory_uri() . '/assets/plugins/fancybox/jquery.fancybox.pack.js', false, false, true);
    /* Select-2 */
    wp_enqueue_style('select2', get_template_directory_uri() . '/assets/plugins/select2/select2.css');
    wp_enqueue_script('select2', get_template_directory_uri() . '/assets/plugins/select2/select2.min.js', false, false, true);
    /* Blox Global Style and Scripts */
    wp_enqueue_style('blox-admin-global-css', BLOX_PATH . 'css/blox-admin-global.css');
    wp_enqueue_script('blox-admin-global-js', BLOX_PATH . 'js/blox-admin-global.js', false, false, true);
    global $post_types;
    if ($post_types != '') {
        foreach ($post_types as $key => $value) {
            if (blox_post_type() == $value) {
                /* Core styles */
                wp_enqueue_style('wp-jquery-ui-dialog');
                /* Core scripts */
                wp_enqueue_script('jquery-ui-core');
                wp_enqueue_script('jquery-ui-accordion');
                wp_enqueue_script('jquery-ui-tabs');
                wp_enqueue_script('jquery-ui-dialog');
                wp_enqueue_script('jquery-ui-sortable');
                wp_enqueue_script('jquery-ui-draggable');
                wp_enqueue_script('jquery-ui-droppable');
                /* Datetime picker */
                wp_enqueue_style('bootstrap-datetimepicker', get_template_directory_uri() . '/assets/plugins/datetimepicker/css/bootstrap-datetimepicker.min.css');
                wp_enqueue_script('bootstrap-datetimepicker', get_template_directory_uri() . '/assets/plugins/datetimepicker/js/bootstrap-datetimepicker.min.js', false, false, true);
                /* Bootstrap only grid style admin scripts */
                wp_enqueue_style('bootstrap', BLOX_PATH . 'css/bootstrap-grid.css');
                wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/plugins/bootstrap/js/bootstrap.min.js', false, false, true);
                /* jQuery plugins */
                wp_enqueue_script('themeton_shortcode', BLOX_PATH . 'js/tinymce_plugin.js', false, false, true);
                wp_enqueue_script('isotope', get_template_directory_uri() . '/assets/plugins/isotope.pkgd.min.js', false, false, true);
                /* General Admin Style and Scripts */
                wp_enqueue_style('blox-admin-style', BLOX_PATH . 'css/blox.css');
                wp_enqueue_script('blox-admin-script', BLOX_PATH . 'js/blox.js', false, false, true);
                include file_require(BLOX_DIR . 'items/items.php');
                $files = array();
                $file_index = 0;
                foreach ($blox_items as $item) {
                    if (isset($item['js']) && $item['js'] != '') {
                        $files[] = BLOX_PATH . 'items/' . $item['js'];
                        wp_enqueue_script('blox_render_scripts' . $file_index, file_require(BLOX_PATH . 'items/' . $item['js'], true), false, false, true);
                        $file_index++;
                    }
                }
                //$minify = new TTMinify();
                //$minify->minify_admin_script($files);
            }
        }
    }
}
Esempio n. 13
0
wp_head();
?>
</head>
<body <?php 
body_class($body_classes);
?>
>


    <div class="layout-wrapper">

        <?php 
while (have_posts()) {
    the_post();
    $blank_page = true;
    include file_require(dirname(__FILE__) . '/template-page.php');
}
?>
        
        <?php 
tt_trackingcode();
?>
        <?php 
wp_footer();
?>

        <!--[if lt IE 9]>
        <script src="<?php 
echo get_template_directory_uri();
?>
/assets/plugins/respond.min.js"></script>
Esempio n. 14
0
<?php

require_once file_require(dirname(__FILE__) . '/class-tgm-plugin-activation.php');
add_action('tgmpa_register', 'themeton_register_required_plugins');
function themeton_register_required_plugins()
{
    /**
     * Array of plugin arrays. Required keys are name and slug.
     * If the source is NOT from the .org repo, then source is also required.
     */
    $plugins = array(array('name' => 'Envato Toolkit', 'slug' => 'envato-wordpress-toolkit', 'source' => get_template_directory() . '/framework/addons/plugins/envato-wordpress-toolkit.zip', 'required' => true, 'version' => '1.7.2', 'force_activation' => true, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Layer Slider', 'slug' => 'LayerSlider', 'source' => get_template_directory() . '/framework/addons/plugins/layersliderwp.zip', 'required' => true, 'version' => '5.6.2', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Revolution Slider', 'slug' => 'revslider', 'source' => get_template_directory() . '/framework/addons/plugins/revslider.zip', 'required' => true, 'version' => '5.0.6', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Master Slider WP', 'slug' => 'masterslider', 'source' => get_template_directory() . '/framework/addons/plugins/masterslider-installable.zip', 'required' => true, 'version' => '2.20.1', 'force_activation' => false, 'force_deactivation' => false, 'external_url' => ''), array('name' => 'Contact Form 7', 'slug' => 'contact-form-7', 'required' => false));
    $config = array('id' => 'themeton_tgm', 'default_path' => '', 'menu' => 'install-required-plugins', 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '', 'is_automatic' => false, 'message' => '', 'strings' => array('page_title' => __('Install Required Plugins', 'tgmpa'), 'menu_title' => __('Install Plugins', 'tgmpa'), 'installing' => __('Installing Plugin: %s', 'tgmpa'), 'oops' => __('Something went wrong with the plugin API.', 'tgmpa'), 'notice_can_install_required' => _n_noop('This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'tgmpa'), 'notice_can_install_recommended' => _n_noop('This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'tgmpa'), 'notice_cannot_install' => _n_noop('Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'tgmpa'), 'notice_can_activate_required' => _n_noop('The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'tgmpa'), 'notice_can_activate_recommended' => _n_noop('The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'tgmpa'), 'notice_cannot_activate' => _n_noop('Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'tgmpa'), 'notice_ask_to_update' => _n_noop('The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'tgmpa'), 'notice_cannot_update' => _n_noop('Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'tgmpa'), 'install_link' => _n_noop('Begin installing plugin', 'Begin installing plugins', 'tgmpa'), 'activate_link' => _n_noop('Begin activating plugin', 'Begin activating plugins', 'tgmpa'), 'return' => __('Return to Required Plugins Installer', 'tgmpa'), 'plugin_activated' => __('Plugin activated successfully.', 'tgmpa'), 'complete' => __('All plugins installed and activated successfully. %s', 'tgmpa'), 'nag_type' => 'updated'));
    tgmpa($plugins, $config);
}
Esempio n. 15
0
define('CORE_PATH', dirname(__FILE__) . '/');
define('__URL__', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']);
define('SITE_PATH', dirname(__URL__) . '/');
/* 设置包含目录 */
$include_path = get_include_path();
$include_path .= PATH_SEPARATOR . APP_PATH . 'controller/';
$include_path .= PATH_SEPARATOR . APP_PATH . 'model/';
$include_path .= PATH_SEPARATOR . APP_PATH . 'view/';
$include_path .= PATH_SEPARATOR . CORE_PATH . 'class/';
set_include_path($include_path);
/* 加载基本函数文件 */
require 'common/common.php';
// 读取基本配置文件
C(include 'config/config.php');
// 读取自定义配置文件
C(include C('APP_CONFIG'));
// 加载常用函数文件
require 'common/function.php';
/* 加载自定义函数文件 */
file_require(APP_PATH . 'common/function.php');
// 注册自动加载函数
spl_autoload_register('autoload');
// 获取访问控制器
$controller = empty($_GET['c']) ? C('DEFAULT_CONTROLLER') : ucfirst($_GET['c']);
$controller .= 'Controller';
if (!class_exists($controller)) {
    $controller = C('DEFAULT_CONTROLLER') . 'Controller';
}
// 运行
$m = new $controller();
$m->run();
Esempio n. 16
0
function ttmegamenu_render_scripts($hook)
{
    if ($hook != 'nav-menus.php') {
        return;
    }
    wp_enqueue_script('jquery');
    if (function_exists('wp_enqueue_media')) {
        wp_enqueue_media();
    }
    wp_enqueue_script('tt_admin_option_script', file_require(get_template_directory_uri() . '/framework/mega-menu/mega-menu.js', true), false, false, true);
}
Esempio n. 17
0
 public static function customizer_custom_admin_head()
 {
     echo '<link rel="stylesheet/less" type="text/css" href="' . file_require(get_template_directory_uri() . '/assets/less/style.less', true) . '" />
            <script>
            less = {
            env: "development",
            async: false,
            fileAsync: false,
            poll: 1000,
            functions: {},
            dumpLineNumbers: "comments",
            relativeUrls: false,
            rootpath: ":/a.com/"
            };
            </script>
            <script src="' . get_template_directory_uri() . '/assets/plugins/less.min.js"></script>';
 }
Esempio n. 18
0
<?php

/**
 * Functions Load
 *
 * @package     WordPress
 * @subpackage  SMOF
 * @since       1.4.0
 * @author      Syamil MJ
 */
require_once file_require(ADMIN_PATH . 'functions/functions.php');
require_once file_require(ADMIN_PATH . 'functions/functions.filters.php');
require_once file_require(ADMIN_PATH . 'functions/functions.interface.php');
require_once file_require(ADMIN_PATH . 'functions/functions.options.php');
require_once file_require(ADMIN_PATH . 'functions/functions.admin.php');
Esempio n. 19
0
            </div>
        </header>
        <!-- ==================================================
        End Header -->
        <?php 
}
?>





        <?php 
while (have_posts()) {
    the_post();
    include file_require(get_template_directory() . '/template-page.php');
}
?>






<?php 
global $smof_data;
$up_footer = tt_getmeta('up_footer', $post->ID);
$up_footer_bar = tt_getmeta('up_footer_bar', $post->ID);
if ($up_footer == '1') {
    $layout = isset($smof_data['footer_layout']) ? $smof_data['footer_layout'] : 3;
    switch ($layout) {
Esempio n. 20
0
 function of_options()
 {
     //Access the WordPress Categories via an Array
     $of_categories = $of_categories_pure = array();
     $of_categories_obj = get_categories('hide_empty=0');
     foreach ($of_categories_obj as $of_cat) {
         $of_categories[$of_cat->cat_ID] = $of_cat->cat_name;
     }
     $of_categories_pure = $of_categories;
     $categories_tmp = array_unshift($of_categories, "Select a category:");
     //Access the WordPress Pages via an Array
     $of_pages = array();
     $of_pages_obj = get_pages('sort_column=post_parent,menu_order');
     foreach ($of_pages_obj as $of_page) {
         $of_pages[$of_page->ID] = $of_page->post_name;
     }
     $of_pages_tmp = array_unshift($of_pages, "Select a page:");
     //Stylesheets Reader
     $alt_stylesheet_path = LAYOUT_PATH;
     $alt_stylesheets = array();
     if (is_dir($alt_stylesheet_path)) {
         if ($alt_stylesheet_dir = opendir($alt_stylesheet_path)) {
             while (($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false) {
                 if (stristr($alt_stylesheet_file, ".css") !== false) {
                     $alt_stylesheets[] = $alt_stylesheet_file;
                 }
             }
         }
     }
     //Background Images Reader
     $bg_images_path = get_stylesheet_directory() . '/images/bg/';
     // change this to where you store your bg images
     $bg_images_url = get_template_directory_uri() . '/images/bg/';
     // change this to where you store your bg images
     $bg_images = array();
     if (is_dir($bg_images_path)) {
         if ($bg_images_dir = opendir($bg_images_path)) {
             while (($bg_images_file = readdir($bg_images_dir)) !== false) {
                 if (stristr($bg_images_file, ".png") !== false || stristr($bg_images_file, ".jpg") !== false) {
                     $bg_images[] = $bg_images_url . $bg_images_file;
                 }
             }
         }
     }
     include_once file_require(ADMIN_PATH . 'functions/google-fonts.php');
     $google_fonts = get_google_webfonts();
     $google_webfonts["default"] = "Default (Helvetica, Arial, sans-serif)";
     foreach ($google_fonts as $font) {
         $google_webfonts[$font['family']] = $font['family'];
     }
     /* ----------------------------------------------------------------------------------- */
     /* TO DO: Add options/functions that use these */
     /* ----------------------------------------------------------------------------------- */
     //More Options
     $uploads_arr = wp_upload_dir();
     $all_uploads_path = $uploads_arr['path'];
     $all_uploads = get_option('of_uploads');
     $other_entries = array("Select a number:", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19");
     $body_repeat = array("no-repeat", "repeat-x", "repeat-y", "repeat");
     $body_pos = array("top left", "top center", "top right", "center left", "center center", "center right", "bottom left", "bottom center", "bottom right");
     // Image Alignment radio box
     $of_options_thumb_align = array("alignleft" => "Left", "alignright" => "Right", "aligncenter" => "Center");
     // Image Links to Options
     $of_options_image_link_to = array("image" => "The Image", "post" => "The Post");
     /* ----------------------------------------------------------------------------------- */
     /* The Options Array */
     /* ----------------------------------------------------------------------------------- */
     global $of_options, $tt_social_icons, $tt_sidebars;
     $of_options = array();
     $url = ADMIN_IMAGES;
     /* General settings
      ***********************************************************************/
     $of_options[] = array("name" => "General Settings", "type" => "heading");
     $of_options[] = array("name" => "CSS Tips!", "std" => "<div style='font-size:14px;'>Please visit the <a target='_blank' href='" . admin_url() . "customize.php'>Site Customize</a> page and change your site's <strong>Logo</strong>, <strong>Color scheme</strong> and <strong>Font options</strong> . And if you don't want to use those changes any more, you should reset them with following options and turn theme back to default.</div>", "icon" => true, "type" => "info");
     $of_options[] = array("name" => "Tracking Code", "desc" => "Add your <a href='http://analytics.google.com' target='_blank'>Google Analytics</a> or other tracking code here. This will be added into the footer of your site.", "id" => "site_analytics", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "Remove Heart Likes", "desc" => "If you don't need any heart/like section on post and widget section, please turn this option ON.", "id" => "remove_heart", "std" => 0, "type" => "switch");
     /* Page builder settings 
      ***********************************************************************/
     $of_options[] = array("name" => "Page Builder", "type" => "info", "std" => "<h3>Page Builder</h3>");
     $of_options[] = array("name" => "", "desc" => "For Posts", "id" => "pb_posts", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "", "desc" => "For Pages", "id" => "pb_pages", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "", "desc" => "For Portfolio", "id" => "pb_port", "std" => 1, "type" => "switch");
     /*
     $of_options[] = array("name" => "For all other post types",
         "desc" => "Controls page builder range on your custom post types.",
         "id" => "pb_other",
         "std" => 0,
         "type" => "switch"
     );
     */
     /* Top Bar settings 
      ***********************************************************************/
     $of_options[] = array("name" => "Top Bar", "type" => "heading");
     $topBarOptions = array('none' => 'Select Item', 'text1' => 'Text 1', 'text2' => 'Text 2', 'shop' => 'Shop cart', 'lang' => 'Language widget of WPML', 'social' => 'Social icons', 'login' => 'Login link', 'menu' => 'Custom menu');
     $of_options[] = array("name" => "Enable Top Bar", "desc" => "", "id" => "top_bar", "std" => 1, "folds" => 1, "type" => "switch");
     $of_options[] = array("name" => "Top Bar (Left)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "top_bar_left_select", "std" => '', "fold" => "top_bar", "type" => "select", "multiple" => false, "options" => $topBarOptions);
     $of_options[] = array("name" => "Top Bar (Left)", "desc" => "", "id" => "top_bar_left", "std" => "text1", "type" => "text");
     $of_options[] = array("name" => "Top Bar (Right)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "top_bar_right_select", "std" => '', "fold" => "top_bar", "type" => "select", "multiple" => false, "options" => $topBarOptions);
     $of_options[] = array("name" => "Top Bar (Right)", "desc" => "", "id" => "top_bar_right", "std" => "login,social,shop", "type" => "text");
     $of_options[] = array("name" => "Text content 1", "desc" => "Please add text content for your top bar.", "id" => "top_bar_text1", "std" => 'Hey there! Welcome to the new site :)', "fold" => "top_bar", "type" => "textarea");
     $of_options[] = array("name" => "Text content 2", "desc" => "Please add text content for your top bar.", "id" => "top_bar_text2", "std" => 'text', "fold" => "top_bar", "type" => "textarea");
     $of_options[] = array("name" => "Social Profiles on Top Bar", "id" => "social_addresses", "fold" => "top_bar", "std" => "<h3>Social Profiles on Top Bar</h3>", "type" => "info");
     foreach ($tt_social_icons as $id => $value) {
         $of_options[] = array("name" => "", "desc" => ucfirst($id) . " address", "id" => "social_" . $id, "fold" => "top_bar", "std" => "", "type" => "text");
     }
     $of_options[] = array("name" => "social_tip", "std" => "<h3 style='margin: 0 0 10px'>Add Custom Social Profile</h3>\n                Here I've added some popular socials. If your familiar social site doesn't have here, you can extend those as following.\n                <p> Please open up the <em>framework/common-functions.php</em> file from theme directory and find <strong>tt_social_icons</strong> array which locates at the top of the file.\n                This is a very popular array that saves social list for above options and widget socials too. So now we need to extend it with our new socials same as their structure (as Name and Icon code). You should find a proper icon for your new social from <a href='http://fortawesome.github.io/Font-Awesome/cheatsheet/' target='_blank'>FontAwesome library</a>.\n                </p>\n                <p>Also you can <strong>reorder</strong> those there.</p>", "icon" => true, "type" => "info");
     /* Post options
      ***********************************************************************/
     $of_options[] = array("name" => "Post And Page", "type" => "heading");
     $of_options[] = array("name" => "Post Options", "std" => "<h3>Post Options</h3>", "type" => "info");
     $of_options[] = array("name" => "Post Format in Single", "desc" => "If you turned this option OFF, post format content won't show on single post pages.", "id" => "show_post_format", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Related Posts", "desc" => "Related posts on bottom of post content in single post page.", "id" => "related_posts", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Author box on Posts", "desc" => "", "id" => "post_author", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Comment on Posts", "desc" => "WordPress has its own way to disable comments in a Post. But you should turn this option OFF if you want to remove comments for all your posts.", "id" => "post_comment", "std" => 1, "type" => "switch");
     /* Page settings
      ***********************************************************************/
     $of_options[] = array("name" => "Page Options", "std" => "<h3>Page Options</h3>", "type" => "info");
     $of_options[] = array("name" => "Author box on Pages", "desc" => "", "id" => "page_author", "std" => 0, "type" => "switch");
     $of_options[] = array("name" => "Comment on Pages", "desc" => "WordPress has its own way to disable comments in a Page. But you should turn this option OFF if you want to remove comments for all your pages.", "id" => "page_comment", "std" => 1, "type" => "switch");
     /* Portfolio
      ***********************************************************************/
     $of_options[] = array("name" => "Portfolio Options", "type" => "heading");
     $of_options[] = array("name" => "Portfolio Slug", "type" => "text", "id" => "portfolio_slug", "desc" => "Portfolio slug that should be show at url for portfolio single items.", "std" => "portfolio-item");
     $of_options[] = array("name" => "Portfolio Columns", "desc" => "Item column on Taxonomy / Category page. You can select 2, 3 and 4 columns layout.", "id" => "portfolio_layout", "std" => "grid3", "type" => "images", "options" => array('grid2' => $url . 'blog-grid2.png', 'grid3' => $url . 'blog-grid3.png', 'grid4' => $url . 'blog-grid4.png'));
     $sidebar_layouts = array('right' => $url . '2cr.png', 'left' => $url . '2cl.png', 'full' => $url . '1col.png');
     $of_options[] = array("name" => "Portolio Sidebar Type", "desc" => "", "id" => "portfolio_sidebar_type", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Portfolio Sidebar", "desc" => "", "id" => "portfolio_sidebar", "std" => "portfolio-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Single Layout", "desc" => "", "id" => "portfolio_single_layout", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Single Sidebar", "desc" => "", "id" => "portfolio_single_sidebar", "std" => "portfolio-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Comment on Portfolio item page", "desc" => "WordPress has its own way to disable comments in a Page. But you should turn this option OFF if you want to remove comments for all your pages.", "id" => "port_comment", "std" => 0, "type" => "switch");
     $of_options[] = array("name" => "Portfolio Next Prev Links at Top", "desc" => "You can turn off <a href='http://d.pr/i/SK3g' target='_blank'>Next Preview and Main page links</a> at right bottom on single portfolio page.", "id" => "port_next_prev_links", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Main Portfolio Page", "desc" => "A page which shows when click on View all button from single portfolio item.", "id" => "portfolio_page", "std" => "", "type" => "select", "options" => $of_pages);
     $of_options[] = array("name" => "Portfolio Related Posts at Bottom", "desc" => "Portfolio Related Posts at bottom of your portfolio item page.", "id" => "port_related", "std" => 1, "type" => "switch");
     /* Archive and Category layout
      ***********************************************************************/
     $of_options[] = array("name" => "Archive Category Tags", "type" => "heading");
     $of_options[] = array("name" => "", "std" => "<h3>Category Layout</h3>", "type" => "info");
     $loop_layouts = array('regular' => $url . 'blog-regular.png', 'grid2' => $url . 'blog-grid2.png', 'grid3' => $url . 'blog-grid3.png', 'grid4' => $url . 'blog-grid4.png', 'masonry2' => $url . 'blog-masonry2.png', 'masonry3' => $url . 'blog-masonry3.png', 'masonry4' => $url . 'blog-masonry4.png');
     $of_options[] = array("name" => "", "desc" => "", "id" => "category_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Category Sidebar Type", "desc" => "", "id" => "category_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Category Sidebar", "desc" => "", "id" => "category_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Archive Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "Archive Layout", "desc" => "", "id" => "archive_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Archive Sidebar Type", "desc" => "", "id" => "archive_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Archive Sidebar", "desc" => "", "id" => "archive_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Tag Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "Tag Layout", "desc" => "", "id" => "tag_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Tag Sidebar Type", "desc" => "", "id" => "tag_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Tag Sidebar", "desc" => "", "id" => "tag_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Search Result Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "search_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Search Sidebar Type", "desc" => "", "id" => "search_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Search Sidebar", "desc" => "", "id" => "search_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "", "std" => "<h3>Author Page Layout</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "author_layout", "std" => "regular", "type" => "images", "options" => $loop_layouts);
     $of_options[] = array("name" => "Sidebar Type on Author Page", "desc" => "", "id" => "author_sidebar_type", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Author Sidebar", "desc" => "", "id" => "author_sidebar", "std" => "blog-sidebar", "type" => "select", "options" => $tt_sidebars);
     /* WooCommerce Options
      ***********************************************************************/
     $of_options[] = array("name" => "WooCommerce", "type" => "heading");
     $of_options[] = array("name" => "WooCommerce Page Layout", "desc" => "", "id" => "woo_layout", "std" => "full", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "WooCommerce Sidebar", "desc" => "", "id" => "woo_sidebar", "std" => "woocommerce-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Product Single Layout", "desc" => "", "id" => "product_layout", "std" => "right", "type" => "images", "options" => $sidebar_layouts);
     $of_options[] = array("name" => "Product Single Sidebar", "desc" => "", "id" => "product_sidebar", "std" => "woocommerce-sidebar", "type" => "select", "options" => $tt_sidebars);
     $of_options[] = array("name" => "Product Overlay Transition", "desc" => "Choose whether you would like the product overlay transition to be enabled.", "id" => "woo_overlay", "std" => 1, "type" => "switch");
     /* Social Options
      ***********************************************************************/
     $of_options[] = array("name" => "Share and Socials", "type" => "heading");
     $share_buttons = array("facebook" => "Facebook", "twitter" => "Twitter", "googleplus" => "Google+", "pinterest" => "Pinterest", 'email' => 'Email');
     $of_options[] = array("name" => "Share Buttons", "desc" => "", "id" => "share_buttons", "std" => array('facebook', 'twitter', 'googleplus', 'pinterest', 'email'), "type" => "multicheck", "options" => $share_buttons);
     $share_visibility = array("share_posts" => "On Posts", "share_pages" => "On Pages", "share_port" => "On Portfolio entries");
     $of_options[] = array("name" => "Visibility of Share Buttons", "desc" => "", "id" => "share_visibility", "std" => 1, "type" => "multicheck", "options" => $share_visibility);
     /* Sidebar Options
      ***********************************************************************/
     $of_options[] = array("name" => "Custom Sidebar", "type" => "heading");
     $of_options[] = array("name" => "Custom sidebar", "desc" => "You can create unlimited siderbars for your site. You should add widgets on <strong>Appearance=><a href='widgets.php'>Widgets</a></strong> after you have added new sidebar here.", "id" => "custom_sidebar", "type" => "sidebar", "std" => "");
     /* Footer Options
      ***********************************************************************/
     $of_options[] = array("name" => "Footer Options", "type" => "heading");
     $of_options[] = array("name" => "Enable Footer", "desc" => "", "id" => "footer", "std" => 1, "type" => "switch");
     $of_options[] = array("name" => "Footer Layout", "desc" => "Those are general footer layouts. If you need more creative footer area there, you should select Footer layout #1 and add your layout content there. It is possible to add page layout shortcode in here with text widget.", "id" => "footer_layout", "std" => "6", "type" => "images", "options" => array('1' => $url . 'footer1.png', '2' => $url . 'footer2.png', '3' => $url . 'footer3.png', '4' => $url . 'footer4.png', '5' => $url . 'footer5.png', '6' => $url . 'footer6.png'));
     $of_options[] = array("name" => "Footer Background Image", "desc" => "Select a background image or pattern.", "id" => "footer_bg_image", "std" => "", "type" => "media");
     $of_options[] = array("name" => "", "desc" => "Repeat", "id" => "footer_bg_repeat", "std" => "", "type" => "select", "options" => $body_repeat);
     $of_options[] = array("name" => "", "desc" => "Position", "id" => "footer_bg_position", "std" => "", "type" => "select", "options" => $body_pos);
     $of_options[] = array("name" => "", "desc" => "Fixed or Scroll", "id" => "footer_bg_fixed", "std" => "scroll", "type" => "select", "options" => array('scroll', 'fixed'));
     /* Footer Bar options
      ***********************************************************************/
     $of_options[] = array("name" => "Footer Bar", "type" => "heading");
     $of_options[] = array("name" => "Footer Bar", "desc" => "", "id" => "sub_footer", "std" => 1, "folds" => 1, "type" => "switch");
     $footerBarOptions = array('none' => 'Select item', 'text1' => 'Text 1', 'text2' => 'Text 2', 'lang' => 'Language widget', 'social' => 'Social icons', 'menu' => 'Custom menu');
     $of_options[] = array("name" => "Footer Bar (Left)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "sub_footer_left_select", "std" => 'text1', "fold" => "sub_footer", "type" => "select", "options" => $footerBarOptions);
     $of_options[] = array("name" => "Footer Bar (Left)", "desc" => "", "id" => "sub_footer_left", "std" => "text1", "type" => "text");
     $of_options[] = array("name" => "Footer Bar (Right)", "desc" => "Please add elements here and order them with mouse drag & drop.", "id" => "sub_footer_right_select", "std" => '', "fold" => "sub_footer", "type" => "select", "options" => $footerBarOptions);
     $of_options[] = array("name" => "Footer Bar (Right)", "desc" => "", "id" => "sub_footer_right", "std" => "text2", "type" => "text");
     $of_options[] = array("name" => "Footer Text 1", "desc" => "", "id" => "footer_bar_text1", "fold" => "sub_footer", "std" => "Powered by WordPress. Developed by <a href='http://themeton.com'>ThemeTon</a>.", "type" => "textarea");
     $of_options[] = array("name" => "Footer Text 2", "desc" => "", "id" => "footer_bar_text2", "fold" => "sub_footer", "std" => "Copyright &copy; 2014.", "type" => "textarea");
     $of_options[] = array("name" => "", "std" => "<h3>Social Profiles on Sub Footer Bar</h3>", "type" => "info");
     $of_options[] = array("name" => "", "desc" => "", "id" => "social_addresses_f", "fold" => "sub_footer", "std" => "", "type" => "");
     foreach ($tt_social_icons as $id => $value) {
         $of_options[] = array("name" => "", "desc" => ucfirst($id) . " address", "id" => "footer_social_" . $id, "fold" => "sub_footer", "std" => "", "type" => "text");
     }
     /* CUSTOM CSS
      ***********************************************************************/
     $of_options[] = array("name" => "LESS", "type" => "heading");
     /* Restore theme options */
     $less_theme_variables_opt = get_theme_mod("less_theme_variables");
     $tmp_arr = array();
     if (!empty($less_theme_variables_opt)) {
         $tmp = unserialize(base64_decode($less_theme_variables_opt));
         if (is_array($tmp)) {
             $tmp_arr = $tmp;
         }
     }
     if (count($tmp_arr) < 1 && get_theme_mod('less-brand-primary') != "") {
         $lessvars = get_less_variables();
         $restored_vars = array();
         foreach ($lessvars as $opt) {
             if ($opt['variable'] != 'less-heading') {
                 $vl = get_theme_mod('less-' . $opt['variable']);
                 remove_theme_mod('less-' . $opt['variable']);
                 $val = $opt['value'];
                 if (!empty($vl) && $vl != $opt['value']) {
                     $val = $vl;
                 }
                 $restored_vars = array_merge($restored_vars, array($opt['variable'] => $val));
             }
         }
         // Save LESS Variables
         if (!empty($restored_vars)) {
             $encoded_str = base64_encode(serialize($restored_vars));
             set_theme_mod("less_theme_variables", $encoded_str);
         }
     } elseif (count($tmp_arr) < 1) {
         $less_vars = array();
         $less_options = get_less_variables();
         foreach ($less_options as $opt) {
             if ($opt['variable'] != 'less-heading' && !empty($opt['variable']) && !empty($opt['value'])) {
                 $less_vars = array_merge($less_vars, array($opt['variable'] => $opt['value']));
             }
             $encoded_str = base64_encode(serialize($less_vars));
             set_theme_mod("less_theme_variables", $encoded_str);
         }
     }
     /* Reformating Theme Option Less Editor */
     $less_content_data = get_less_editor_content($less_theme_variables_opt);
     if (isset($smof_data['less_editor'])) {
         $smof_data['less_editor'] = $less_content_data;
     }
     set_theme_mod('less_editor', $less_content_data);
     $of_options[] = array("name" => "LESS Editor", "desc" => "LESS Code Editor", "id" => "less_editor", "std" => $less_content_data, "type" => "textarea");
     /* CUSTOM CSS
      ***********************************************************************/
     $of_options[] = array("name" => "Custom CSS", "type" => "heading");
     $of_options[] = array("name" => "CSS Tips!", "std" => "<h3 style=\"margin: 0 0 10px;\">Tips, Before customizing</h3>\n                Control everything is impossible with options. Therefore we have to use custom styling for our sites if we have deep changes. \n                You can make your changes in css files but it doesn't safe and probably you lose those for next version updates of the theme. Then I suggest you to use following options. It is a safe place :)\n\n                <p>If you don't have enough experience with CSS and selectors, you should visit following links\n                <ul style='margin-left:20px'>\n                    <li> - Learn about <a href='http://www.w3schools.com/cssref/css_selectors.asp' target='_blank'>CSS selectors</a></li>\n                    <li> - Learn about <a href='http://net.tutsplus.com/tutorials/html-css-techniques/the-30-css-selectors-you-must-memorize/' target='_blank'>CSS selectors</a> by Jeffrey Way</li>\n                    <li> - How to use <a href='http://www.youtube.com/watch?v=nOEw9iiopwI' target='_blank'>Chrome Inspector</a></li>\n                    <li> - How to use <a href='http://www.youtube.com/watch?v=3KdNRZS-uSg' target='_blank'>Mozilla Firebug</a> for editing css</li>\n                </ul>\n                </p>", "icon" => true, "type" => "info");
     $of_options[] = array("name" => "Custom CSS (General)", "desc" => "", "id" => "custom_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Tablets", "desc" => "Screen width between 768px and 985px", "id" => "tablet_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Wide Phones", "desc" => "Screen width between 480px and 767px", "id" => "wide_phone_css", "std" => "", "type" => "textarea");
     $of_options[] = array("name" => "For Phone", "desc" => "Screen width up to 479px", "id" => "phone_css", "std" => "", "type" => "textarea");
     /* Backup and Restore
      ***********************************************************************/
     $of_options[] = array("name" => "Backup Options", "type" => "heading");
     $of_options[] = array("name" => "Backup and Restore Options", "id" => "of_backup", "std" => "", "type" => "backup", "desc" => 'You can use the two buttons below to backup your current options, and then restore it back at a later time. This is useful if you want to experiment on the options but would like to keep the old settings in case you need it back.');
     $of_options[] = array("name" => "Transfer Theme Options Data", "id" => "of_transfer", "std" => "", "type" => "transfer", "desc" => 'You can tranfer the saved options data between different installs by copying the text inside the text box. To import data from another install, replace the data in the text box with the one from another install and click "Import Options".');
 }
Esempio n. 21
0
function themeton_enqueue_scripts()
{
    /* jQuery */
    wp_enqueue_script('jquery');
    global $smof_data;
    /* Google Fonts */
    import_google_fonts();
    /* Bootstrap */
    wp_enqueue_style('bootstrap', get_template_directory_uri() . '/assets/plugins/bootstrap/css/bootstrap.min.css');
    wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/plugins/bootstrap/js/bootstrap.min.js', false, false, true);
    /* Device-Mockups */
    wp_enqueue_style('device-mockups', get_template_directory_uri() . '/assets/plugins/device-mockups/device-mockups.css');
    /* Pretty Photo */
    wp_enqueue_style('prettyPhoto', get_template_directory_uri() . '/assets/plugins/prettyPhoto/css/prettyPhoto.css');
    wp_enqueue_script('prettyPhoto', get_template_directory_uri() . '/assets/plugins/prettyPhoto/js/jquery.prettyPhoto.js', false, false, true);
    /* Swiper */
    wp_enqueue_style('swiper', get_template_directory_uri() . '/assets/plugins/swiper/idangerous.swiper.css');
    wp_enqueue_script('swiper', get_template_directory_uri() . '/assets/plugins/swiper/idangerous.swiper.js', false, false, true);
    /* Theme CSS */
    wp_enqueue_style('animate', get_template_directory_uri() . '/assets/css/animate.css');
    wp_enqueue_style('theme-default-styles', get_stylesheet_uri());
    wp_enqueue_style('theme-style', get_less_to_css_path());
    /* Ultimate Page Custom LESS */
    global $post;
    if (isset($post->ID) && get_post_meta($post->ID, '_wp_page_template', true) == 'page-ultimate.php') {
        $ultimate_css = get_ultimate_css_url();
        if ($ultimate_css !== false) {
            wp_enqueue_style('theme-ultimate', $ultimate_css);
        }
    }
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    /* Theme JS */
    wp_enqueue_script('waypoint', get_template_directory_uri() . '/assets/plugins/waypoints.min.js', false, false, true);
    wp_enqueue_script('stellar', get_template_directory_uri() . '/assets/plugins/stellar.js/jquery.stellar.min.js', false, false, true);
    wp_enqueue_script('scrollto', get_template_directory_uri() . '/assets/plugins/jquery.scrollto.min.js', false, false, true);
    wp_enqueue_script('localscroll', get_template_directory_uri() . '/assets/plugins/jquery.localscroll.min.js', false, false, true);
    wp_enqueue_script('isotope', get_template_directory_uri() . '/assets/plugins/isotope.pkgd.min.js', false, false, true);
    wp_enqueue_script('fitvideo', get_template_directory_uri() . '/assets/plugins/jquery.fitvids.js', false, false, true);
    wp_enqueue_script('jcycle2', get_template_directory_uri() . '/assets/plugins/jquery.cycle2.min.js', false, false, true);
    wp_enqueue_script('jplayer', get_template_directory_uri() . '/assets/plugins/jplayer/jquery.jplayer.min.js', false, false, true);
    wp_enqueue_script('counterup', get_template_directory_uri() . '/assets/plugins/jquery.counterup.min.js', false, false, true);
    wp_enqueue_script('themeton-menu', get_template_directory_uri() . '/assets/js/themeton.menu.js', false, false, true);
    wp_enqueue_script('theme-script', file_require(get_template_directory_uri() . '/assets/js/scripts.js', true), false, false, true);
}