/** * Add different CSS classes to body tag. * Outputs skin name and layout. * * @since 1.0.3 * * @param array * @return array */ function themify_base_body_classes($classes) { // Add skin name if ($skin = themify_base_get('skin')) { $classes[] = 'skin-' . $skin; } else { $classes[] = 'skin-default'; } // Browser classes global $is_gecko, $is_opera, $is_iphone, $is_IE, $is_winIE, $is_macIE; $is_android = stripos($_SERVER['HTTP_USER_AGENT'], 'android') ? true : false; $is_webkit = stripos($_SERVER['HTTP_USER_AGENT'], 'webkit') ? true : false; $is_ie10 = stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE 10') ? true : false; $is_ie9 = stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE 9') ? true : false; $is_ie8 = stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') ? true : false; $is_ie7 = stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') ? true : false; $is_not_ie = true; $browsers = array('gecko' => $is_gecko, 'opera' => $is_opera, 'iphone' => $is_iphone, 'android' => $is_android, 'webkit' => $is_webkit, 'ie' => $is_IE, 'iewin' => $is_winIE, 'iemac' => $is_macIE, 'ie10' => $is_ie10, 'ie9' => $is_ie9, 'ie8' => $is_ie8, 'ie7' => $is_ie7); foreach ($browsers as $browser => $state) { if ($state) { $classes[] = $browser; if (stripos($browser, 'ie') !== false) { $is_not_ie = false; } } } if ($is_not_ie) { $classes[] = 'not-ie'; } $layout = themify_base_get_sidebar_layout(); // If still empty, set default if (apply_filters('themify_default_layout_condition', '' == $layout)) { $layout = apply_filters('themify_default_layout', 'sidebar1'); } $classes[] = $layout; return apply_filters('themify_base_body_classes', $classes); }
define('THEME_DIR', get_template_directory()); define('THEME_URI', get_template_directory_uri()); define('THEMIFY_BASE_DIR', THEME_DIR . '/themify'); define('THEMIFY_BASE_URI', THEME_URI . '/themify'); define('THEMIFY_NO_FRAMEWORK', true); ////////////////////////////////////////////////////////////////////////// // Load files ////////////////////////////////////////////////////////////////////////// $theme_includes = apply_filters('themify_theme_includes', array('themify/class-themify-mobile-detect.php', 'themify/themify-modules.php', 'themify/themify-functions.php', 'themify/customizer/class-themify-customizer.php', 'custom-functions.php')); foreach ($theme_includes as $include) { locate_template($include, true); } // Themify Customizer is initialized in its own file // Set content width for media if (!isset($content_width)) { if ('sidebar-none' == themify_base_get_sidebar_layout()) { $content_width = 1160; } else { $content_width = 858; } } // Setup theme add_action('after_setup_theme', 'themify_base_theme_setup'); /** * Setup everything needed in the theme. */ function themify_base_theme_setup() { // Get theme settings $GLOBALS['themify_settings'] = get_option('themify_settings'); ///////////////////////////////////////
<?php /** * Template for Main Sidebar * @package themify * @since 1.0.0 */ $sidebar = themify_base_get_sidebar_layout(); if ('sidebar-none' == $sidebar) { return; } ?> <?php themify_base_sidebar_before(); // hook ?> <aside id="sidebar"> <?php themify_base_sidebar_start(); // hook ?> <?php dynamic_sidebar('sidebar-main'); ?> <?php themify_base_sidebar_end();