function scp_get_wheels_option($option_name, $default = false) { if (function_exists('wheels_get_option')) { return wheels_get_option($option_name, $default); } return $default; }
function wheels_register_custom_thumbnail_sizes() { $string = wheels_get_option('custom-thumbnail-sizes'); if ($string) { $pattern = '/[^a-zA-Z0-9\\-\\|\\:]/'; $replacement = ''; $string = preg_replace($pattern, $replacement, $string); $resArr = explode('|', $string); $thumbs = array(); foreach ($resArr as $thumbString) { if (!empty($thumbString)) { $parts = explode(':', trim($thumbString)); $thumbs[$parts[0]] = explode('x', $parts[1]); } } foreach ($thumbs as $name => $sizes) { add_image_size($name, (int) $sizes[0], (int) $sizes[1], true); } } }
function wheels_set_js_global_var() { $scroll_to_top_text = wheels_get_option('scroll-to-top-text', 'Scroll to Top'); ?> <script> var wheels = wheels || { siteName: "<?php bloginfo('name'); ?> ", data: { useScrollToTop: <?php echo json_encode(filter_var(wheels_get_option('use-scroll-to-top', true), FILTER_VALIDATE_BOOLEAN)); ?> , useStickyMenu: <?php echo json_encode(filter_var(wheels_get_option('main-menu-use-menu-is-sticky', true), FILTER_VALIDATE_BOOLEAN)); ?> , scrollToTopText: '<?php echo $scroll_to_top_text; ?> ', isAdminBarShowing: <?php echo is_admin_bar_showing() ? 'true' : 'false'; ?> , initialWaypointScrollCompensation: <?php echo json_encode(wheels_get_option('main-menu-initial-waypoint-compensation', 120)); ?> } }; </script> <?php }
/** * @param string $namespace * @param array $options * * @return mixed|void */ function wheels_class($namespace, $options = array()) { $class = ''; $padding_class = 'wh-padding'; $row_class = 'cbp-row'; $container_class = 'cbp-container'; /** * Main Wrapper */ if ($namespace == 'main-wrapper') { $use_embellishments = wheels_get_option('content-embellishments-enable', false); $embellishment_class = ''; if ($use_embellishments) { $embellishment_top_img = wheels_get_option('content-embellishment-background-top', array()); $embellishment_top_img_url = isset($embellishment_top_img['background-image']) && $embellishment_top_img['background-image'] ? $embellishment_top_img['background-image'] : ''; $embellishment_bottom_img = wheels_get_option('content-embellishment-background-bottom', array()); $embellishment_bottom_img_url = isset($embellishment_bottom_img['background-image']) && $embellishment_bottom_img['background-image'] ? $embellishment_bottom_img['background-image'] : ''; $embellishment_class = ' wh-has-embellishment'; if ($embellishment_top_img_url) { $embellishment_class .= ' wh-embellishment-type-content-top'; } if ($embellishment_bottom_img_url) { $embellishment_class .= ' wh-embellishment-type-content-bottom'; } } $class = $row_class . ' wh-content' . $embellishment_class; /** * Row */ } elseif ($namespace == 'row') { $class = $row_class; /** * Container */ } elseif ($namespace == 'container') { $class = $container_class; /** * Container */ } elseif ($namespace == 'container_home_content') { $class = $container_class . ' ' . $padding_class; /** * Strecher */ } elseif ($namespace == 'strecher') { $class = 'cbp-strecher'; /** * Content */ } elseif ($namespace == 'content') { $content_width = wheels_get_option('content-width', 9); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$content_width - 1][0] . ' ' . $padding_class; /** * Content - Fullwidth */ } elseif ($namespace == 'content-fullwidth') { $class = 'entry-content one whole ' . $padding_class; /** * Sidebar */ } elseif ($namespace == 'sidebar') { $sidebar_width = wheels_get_option('sidebar-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = 'wh-sidebar ' . $mapped_grid_classes[$sidebar_width - 1][0] . ' ' . $padding_class; /** * Logo Wrapper */ } elseif ($namespace == 'logo-wrapper') { $logo_width = wheels_get_option('logo-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$logo_width - 1][0] . ' ' . $padding_class; /** * Logo */ } elseif ($namespace == 'logo') { $logo_alignment = wheels_get_option('logo-alignment', 'left'); $class = 'wh-logo'; switch ($logo_alignment) { case 'left': $class .= ' align-left'; break; case 'right': $class .= ' align-right'; break; case 'center': $class .= ' align-center'; break; } /** * Main Bar Wrapper */ } elseif ($namespace == 'main-menu-bar-wrapper') { $enable_sticky = wheels_get_option('main-menu-use-menu-is-sticky', 1); $class = 'wh-main-menu-bar-wrapper'; if ($enable_sticky) { $class .= ' wh-sticky-header-enabled'; } /** * Main Menu Wrapper */ } elseif ($namespace == 'main-menu-wrapper') { $logo_width = wheels_get_option('logo-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$logo_width - 1][1] . ' ' . $padding_class; /** * Main Menu Wrapper */ } elseif ($namespace == 'mega-main-menu-wrapper') { $class = 'mega-main-menu-wrapper'; /** * Main Menu */ } elseif ($namespace == 'main-menu') { $menu_alignment = wheels_get_option('main-menu-alignment', 'left'); $class = 'sf-menu wh-menu-main'; switch ($menu_alignment) { case 'left': $class .= ' pull-left'; break; case 'right': $class .= ' pull-right'; break; } /** * Main Menu Container */ } elseif ($namespace == 'main-menu-container') { $menu_alignment = wheels_get_option('main-menu-alignment'); if ($menu_alignment && $menu_alignment == 'center') { $class = 'wh-ul-center'; } /** * Bottom Widgets */ } elseif ($namespace == 'bottom-widgets') { $class = $row_class . ' wh-footer'; /** * Footer */ } elseif ($namespace == 'footer') { $class = $row_class . ' wh-footer-bottom'; /** * Footer Widgets */ } elseif ($namespace == 'widget-footer') { $widget_width = wheels_get_option('footer-widget-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$widget_width - 1][0] . ' ' . $padding_class; /** * Footer Menu Wrap */ } elseif ($namespace == 'footer-menu-wrap') { $widget_width = wheels_get_option('footer-elements-grid', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$widget_width - 1][0] . ' ' . $padding_class; /** * Footer Menu */ } elseif ($namespace == 'footer-menu') { $menu_alignment = wheels_get_option('footer-menu-alignment', 'left'); $class = 'sf-menu wh-menu-footer'; switch ($menu_alignment) { case 'left': $class .= ' pull-left'; break; case 'right': $class .= ' pull-right'; break; } /** * Footer Menu Container */ } elseif ($namespace == 'footer-menu-container') { $menu_alignment = wheels_get_option('footer-menu-alignment'); $class = 'wh-footer-menu-wrap'; if ($menu_alignment && $menu_alignment == 'center') { $class = 'wh-ul-center'; } /** * Footer Text */ } elseif ($namespace == 'footer-text') { $widget_width = wheels_get_option('footer-elements-grid', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$widget_width - 1][1] . ' ' . $padding_class; $menu_alignment = wheels_get_option('footer-text-alignment', 'left'); $alignment_class = ''; switch ($menu_alignment) { case 'left': $alignment_class = ' align-left'; break; case 'right': $alignment_class = ' align-right'; break; case 'center': $alignment_class = ' align-center'; break; } $class .= $alignment_class; /** * Header */ } elseif ($namespace == 'header') { $use_sticky_menu = wheels_get_option('use-sticky-menu', true); $use_embellishments = wheels_get_option('header-embellishments-enable', false); $embellishment_class = ''; if ($use_embellishments) { $embellishment_top_img = wheels_get_option('header-embellishment-background-top', array()); $embellishment_top_img_url = isset($embellishment_top_img['background-image']) && $embellishment_top_img['background-image'] ? $embellishment_top_img['background-image'] : ''; $embellishment_bottom_img = wheels_get_option('header-embellishment-background-bottom', array()); $embellishment_bottom_img_url = isset($embellishment_bottom_img['background-image']) && $embellishment_bottom_img['background-image'] ? $embellishment_bottom_img['background-image'] : ''; $embellishment_class = ' wh-has-embellishment'; if ($embellishment_top_img_url) { $embellishment_class .= ' wh-embellishment-type-header-top'; } if ($embellishment_bottom_img_url) { $embellishment_class .= ' wh-embellishment-type-header-bottom'; } } $class = $row_class . ' wh-header wh-header-inner ' . $embellishment_class; /** * Pagination */ } elseif ($namespace == 'pagination') { $class = 'double-pad-top'; /** * Post */ } elseif ($namespace == 'post-item') { $class = 'one whole wh-post-item'; /** * Post one half */ } elseif ($namespace == 'post-item-one-half') { $class = 'one whole wh-post-item one half'; /** * Page Title Row */ } elseif ($namespace == 'page-title-row') { $use_embellishments = wheels_get_option('page-title-embellishments-enable', false); $embellishment_class = ''; if ($use_embellishments) { $embellishment_top_img = wheels_get_option('page-title-embellishment-background-top', array()); $embellishment_top_img_url = isset($embellishment_top_img['background-image']) && $embellishment_top_img['background-image'] ? $embellishment_top_img['background-image'] : ''; $embellishment_bottom_img = wheels_get_option('page-title-embellishment-background-bottom', array()); $embellishment_bottom_img_url = isset($embellishment_bottom_img['background-image']) && $embellishment_bottom_img['background-image'] ? $embellishment_bottom_img['background-image'] : ''; $embellishment_class = ' wh-has-embellishment'; if ($embellishment_top_img_url) { $embellishment_class .= ' wh-embellishment-type-page-title-top'; } if ($embellishment_bottom_img_url) { $embellishment_class .= ' wh-embellishment-type-page-title-bottom'; } } $class = $row_class . ' wh-page-title-bar' . $embellishment_class; /** * Page Title Grid Wrapper */ } elseif ($namespace == 'page-title-grid-wrapper') { $class = 'one whole ' . $padding_class . ' wh-page-title-wrapper'; /** * Page Title */ } elseif ($namespace == 'page-title') { $class = 'page-title'; /** * Breadcrumbs */ } elseif ($namespace == 'breadcrumbs') { $menu_alignment = wheels_get_option('page-title-breadcrumbs-alignment', 'left'); $alignment_class = ''; switch ($menu_alignment) { case 'left': $alignment_class = 'align-left'; break; case 'right': $alignment_class = 'align-right'; break; case 'center': $alignment_class = 'align-center'; break; } $class = 'wh-breadcrumbs ' . $alignment_class; /** * Top Bar Menu Wrap */ } elseif ($namespace == 'top-bar') { $class = $row_class . ' wh-top-bar'; /** * Top Bar Menu Wrap */ } elseif ($namespace == 'top-bar-menu-wrap') { $widget_width = wheels_get_option('top-bar-menu-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$widget_width - 1][0] . ' ' . $padding_class; /** * Top Bar Text */ } elseif ($namespace == 'top-bar-text') { $widget_width = wheels_get_option('top-bar-text-width', 3); $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[$widget_width - 1][0] . ' ' . $padding_class; $menu_alignment = wheels_get_option('top-bar-text-alignment', 'left'); $alignment_class = ''; switch ($menu_alignment) { case 'left': $alignment_class = ' align-left'; break; case 'right': $alignment_class = ' align-right'; break; case 'center': $alignment_class = ' align-center'; break; } $class .= $alignment_class; /** * Top Bar Additional */ } elseif ($namespace == 'top-bar-additional') { $class = $row_class . ' wh-top-bar-additional'; /** * Top Bar Additional Text */ } elseif ($namespace == 'top-bar-additional-text') { $mapped_grid_classes = wheels_grid_class_map(); $class = $mapped_grid_classes[12 - 1][0] . ' ' . $padding_class; $menu_alignment = wheels_get_option('top-bar-additional-text-alignment', 'left'); $alignment_class = ''; switch ($menu_alignment) { case 'left': $alignment_class = ' align-left'; break; case 'right': $alignment_class = ' align-right'; break; case 'center': $alignment_class = ' align-center'; break; } $class .= $alignment_class; /** * Top Menu */ } elseif ($namespace == 'top-menu') { $menu_alignment = wheels_get_option('top-bar-menu-alignment', 'left'); $class = 'sf-menu wh-menu-top'; switch ($menu_alignment) { case 'left': $class .= ' pull-left'; break; case 'right': $class .= ' pull-right'; break; } /** * Top Menu Container */ } elseif ($namespace == 'top-menu-container') { $menu_alignment = wheels_get_option('top-bar-menu-alignment'); $class = 'wh-top-menu-wrap'; if ($menu_alignment && $menu_alignment == 'center') { $class = 'wh-ul-center'; } /** * Top Menu Container */ } elseif ($namespace == 'dntp-featured-courses-item-img-is-rounded') { $is_rounded = wheels_get_option('dntp-featured-courses-item-img-is-rounded'); if ($is_rounded) { $class = 'wh-rounded'; } } else { $class = $namespace; } return apply_filters('wheels_filter_class', $class, $namespace); }
<?php wheels_get_thumbnail('wh-featured-image'); ?> </div> <div class="entry-content"> <?php the_content(); ?> </div> <div> <?php wp_link_pages(array('before' => '<nav class="page-nav"><p>' . __('Pages:', 'wheels'), 'after' => '</p></nav>')); ?> </div> <?php if (wheels_get_option('archive-single-use-share-this', false)) { ?> <!-- http://simplesharingbuttons.com/ --> <ul class="share-buttons"> <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(site_url()); ?> &t=" target="_blank" title="Share on Facebook" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL)); return false;"><i class="fa fa-facebook-square fa-2x"></i></a></li> <li><a href="https://twitter.com/intent/tweet?source=<?php echo urlencode(site_url()); ?> &text=:%20<?php echo urlencode(site_url()); ?> " target="_blank" title="Tweet" onclick="window.open('https://twitter.com/intent/tweet?text=' + encodeURIComponent(document.title) + ':%20' + encodeURIComponent(document.URL)); return false;"><i class="fa fa-twitter-square fa-2x"></i></a></li> <li><a href="https://plus.google.com/share?url=<?php
<?php $logo = wheels_get_option('logo', array()); $logo_url = isset($logo['url']) && $logo['url'] ? $logo['url'] : ''; if ($logo_url) { ?> <div class="<?php echo wheels_class('logo'); ?> "> <a href="<?php echo home_url(); ?> "> <img src="<?php echo $logo_url; ?> " alt="logo"> </a> </div> <?php } else { ?> <div class="<?php echo wheels_class('logo'); ?> "> <h1 class="site-title"> <a href="<?php echo esc_url(home_url('/')); ?>
function wheels_responsive_menu_scripts() { $respmenu_use = (int) wheels_get_option('respmenu-use', 1); $respmenu_show_start = (int) wheels_get_option('respmenu-show-start', 767); $respmenu_logo = wheels_get_option('respmenu-logo', array()); $respmenu_logo_url = isset($respmenu_logo['url']) && $respmenu_logo['url'] ? $respmenu_logo['url'] : ''; $respmenu_display_switch_logo = wheels_get_option('respmenu-display-switch-img', array()); $top_bar_additional_show_on_mobile = wheels_get_option('top-bar-additional-show-on-mobile', false); $respmenu_display_switch_logo_url = isset($respmenu_display_switch_logo['url']) && $respmenu_display_switch_logo['url'] ? $respmenu_display_switch_logo['url'] : ''; if ($respmenu_use && $respmenu_show_start) { ?> <style> @media screen and (max-width: <?php echo $respmenu_show_start; ?> px) { #cbp-menu-main { width: 100%; } .respmenu-wrap { display:block } .wh-main-menu-bar-wrapper, .wh-top-bar { display: none; } <?php if (!$top_bar_additional_show_on_mobile) { ?> .wh-header { display: none; } <?php } ?> } </style> <script> var wheels = wheels || {}; wheels.data = wheels.data || {}; wheels.data.respmenu = { id: 'cbp-menu-main', options: { id: 'cbp-menu-main-respmenu', submenuToggle: { className: 'cbp-respmenu-more', html: '<i class="fa fa-chevron-down"></i>' }, logo: { src: '<?php echo $respmenu_logo_url; ?> ', link: '<?php echo home_url(); ?> ' }, toggleSwitch: { src: '<?php echo $respmenu_display_switch_logo_url; ?> ' }, prependTo: 'body' } }; </script> <?php } }
<?php $enable_breadcrumbs = wheels_get_option('page-title-breadcrumbs-enable', true); $breadcrumbs_position = wheels_get_option('page-title-breadcrumbs-position', 'bellow_title'); ?> <div class="<?php echo wheels_class('page-title-row'); ?> "> <div class="<?php echo wheels_class('container'); ?> "> <div class="<?php echo wheels_class('page-title-grid-wrapper'); ?> "> <?php if ($enable_breadcrumbs && $breadcrumbs_position == 'above_title') { ?> <?php get_template_part('templates/breadcrumbs'); ?> <?php } ?> <h1 class="<?php echo wheels_class('page-title'); ?> "><?php echo wheels_title();
get_header('boxed'); } else { get_header(); } get_template_part('templates/title'); ?> <div class="<?php echo wheels_class('main-wrapper'); ?> "> <div class="<?php echo wheels_class('container'); ?> "> <?php if (wheels_get_option('single-post-sidebar-left', false)) { ?> <div class="<?php echo wheels_class('sidebar'); ?> "> <?php get_sidebar(); ?> </div> <div class="<?php echo wheels_class('content'); ?> "> <?php get_template_part('templates/content-single');
<div class="<?php echo wheels_class('top-bar'); ?> "> <div class="<?php echo wheels_class('container'); ?> "> <?php $top_bar_layout = wheels_get_option('top-bar-layout', array()); $sections = isset($top_bar_layout['enabled']) ? $top_bar_layout['enabled'] : false; if ($sections) { foreach ($sections as $key => $value) { switch ($key) { case 'menu': get_template_part('templates/top-bar-menu'); break; case 'text': get_template_part('templates/top-bar-text'); break; case 'login_button': get_template_part('templates/top-bar-login-button'); break; } } } ?> </div> </div>
<?php get_template_part('templates/head'); $rtl = wheels_get_option('is-rtl', false) ? ' dir="rtl"' : ''; ?> <body <?php body_class(); echo $rtl; ?> > <?php get_template_part('templates/header');
dynamic_sidebar('wheels-sidebar-footer'); ?> </div> <?php } ?> <div class="<?php echo wheels_class('footer'); ?> "> <div class="<?php echo wheels_class('container'); ?> "> <?php $footer_layout = wheels_get_option('footer-layout', array()); $sections = isset($footer_layout['enabled']) ? $footer_layout['enabled'] : false; if ($sections) { foreach ($sections as $key => $value) { switch ($key) { case 'menu': get_template_part('templates/footer-menu'); break; case 'text': get_template_part('templates/footer-text'); break; } } } ?> </div>
<?php $top_bar_additional_text = wheels_get_option('top-bar-additional-text', ''); ?> <div class="<?php echo wheels_class('top-bar-additional'); ?> "> <div class="<?php echo wheels_class('container'); ?> "> <?php if ($top_bar_additional_text) { ?> <div class="<?php echo wheels_class('top-bar-additional-text'); ?> "> <?php echo do_shortcode($top_bar_additional_text); ?> </div> <?php } ?> </div> </div>
/** * Clean up the_excerpt() */ function wheels_excerpt_length($length) { $post_excerpt_length = wheels_get_option('post-excerpt-length', POST_EXCERPT_LENGTH); return $post_excerpt_length; }
<?php $footer_text = wheels_get_option('footer-text', ''); if ($footer_text) { ?> <div class="<?php echo wheels_class('footer-text'); ?> "> <?php echo do_shortcode($footer_text); ?> </div> <?php }
<?php global $post_id; $use_top_bar = wheels_get_option('top-bar-use', false); $use_top_bar_additional = wheels_get_option('top-bar-additional-use', false); ?> <header class="<?php echo wheels_class('header'); ?> "> <?php if ($use_top_bar) { ?> <?php get_template_part('templates/top-bar'); ?> <?php } ?> <?php if ($use_top_bar_additional) { ?> <?php get_template_part('templates/top-bar-additional'); ?> <?php } ?> <div class="<?php echo wheels_class('main-menu-bar-wrapper'); ?>
<?php $top_bar_text = wheels_get_option('top-bar-text', ''); if ($top_bar_text) { ?> <div class="<?php echo wheels_class('top-bar-text'); ?> "> <?php echo do_shortcode($top_bar_text); ?> </div> <?php }