function wm_body_classes($classes) { //Helper variables global $post, $paged, $page; if (!isset($paged)) { $paged = 0; } if (!isset($page)) { $page = 0; } $paginated = max($paged, $page); $body_classes = array(); $post_id = is_home() ? get_option('page_for_posts') : null; //WooCommerce support $wc_shop = false; if (class_exists('WooCommerce') && is_shop()) { $post_id = wc_get_page_id('shop'); $wc_shop = true; } //Preparing output //Website layout $body_classes[0] = trim(wm_option('skin-layout')); if ((!is_search() && !is_archive() || $wc_shop) && (function_exists('wma_meta_option') && wma_meta_option('layout', $post_id))) { $body_classes[0] = trim(wma_meta_option('layout', $post_id)); $body_classes[10] = 'post-meta-layout'; } if (wm_no_header_footer()) { $body_classes[0] = 'fullwidth'; } //Topbar if (!apply_filters('wmhook_disable_header', false)) { if (is_active_sidebar('topbar')) { $body_classes[20] = 'topbar-enabled'; } if (is_active_sidebar('topbar-extra') && !apply_filters('wmhook_wm_section_topbar_extra_disable', false)) { $body_classes[30] = 'topbar-extra-enabled'; } } //Header layout if (wm_option('skin-header-sticky')) { $body_classes[40] = 'sticky-header'; $body_classes[50] = 'sticky-header-global'; } //Slider type if (function_exists('wma_meta_option') && wma_meta_option('slider', $post_id) && 2 > $paginated) { $body_classes[40] = 'sticky-header'; $body_classes[60] = 'slider-enabled slider-fade-out slider-type-' . wma_meta_option('slider', $post_id); } //One page layout if (is_page_template('page-template/one-page.php')) { $body_classes[40] = 'sticky-header'; $body_classes[70] = 'one-page-layout'; } //Full posts if (apply_filters('wmhook_enable_blog_full_posts', false) && is_home()) { $body_classes[80] = 'list-articles-full'; } else { $body_classes[80] = 'list-articles-short'; } //Theme lightbox used if (!wm_option('skin-disable-lightbox')) { $body_classes[90] = 'theme-lightbox-enabled'; } //Requirements check //Premature output if WebMan Amplifier not used if (!function_exists('wma_meta_option')) { $body_classes = apply_filters('wmhook_wm_body_classes_output', $body_classes); $classes = array_merge($classes, $body_classes); asort($classes); return $classes; } //No sidebar on blog and archives if (is_home() && 'none' == wma_meta_option('sidebar', $post_id) || is_page_template('home.php') && 'none' == wma_meta_option('sidebar', $post_id) || is_archive() && apply_filters('wmhook_archive_disable_sidebar', false)) { $body_classes[100] = 'no-sidebar'; } //WooCommerce support if (class_exists('WooCommerce')) { if (is_woocommerce()) { $body_classes[110] = 'shop-columns-' . wm_wc_products_columns(); } if (function_exists('wm_wc_floating_cart') && wm_wc_floating_cart(true)) { $body_classes[120] = 'floating-cart-enabled'; } } //bbPress support if (class_exists('bbPress') && bbp_is_single_topic() && apply_filters('wmhook_enable_large_topic', true)) { $body_classes[130] = 'bbpress-large-topic'; } //Page layout if (wma_meta_option('sidebar')) { $body_classes[140] = 'page-layout-' . wma_meta_option('sidebar'); } //Responsiveness $body_classes[150] = 'responsive-design'; //Output $body_classes = apply_filters('wmhook_wm_body_classes_output', $body_classes); $classes = array_merge($classes, $body_classes); asort($classes); return $classes; }
/** * Output product up sells. * * @access public * @param int $posts_per_page (default: -1) * @param int $columns (default: 2) * @param string $orderby (default: 'rand') * @return void * * @wmedit Default $post_per_page, $columns */ function woocommerce_upsell_display($posts_per_page = '-1', $columns = 2, $orderby = 'rand') { $posts_per_page = $columns = wm_wc_products_columns(); wc_get_template('single-product/up-sells.php', array('posts_per_page' => $posts_per_page, 'orderby' => apply_filters('woocommerce_upsells_orderby', $orderby), 'columns' => $columns)); }