/**
 * Adds custom classes to the array of body classes.
 *
 * @since vantage 1.0
 */
function vantage_body_classes($classes)
{
    // Adds a class of group-blog to blogs with more than 1 published author
    if (is_multi_author()) {
        $classes[] = 'group-blog';
    }
    if (siteorigin_setting('layout_responsive')) {
        $classes[] = 'responsive';
    }
    $classes[] = 'layout-' . siteorigin_setting('layout_bound');
    $classes[] = 'no-js';
    $is_full_width_template = is_page_template('templates/template-full.php') || is_page_template('templates/template-full-notitle.php');
    if (!$is_full_width_template) {
        $wc_shop_sidebar = vantage_is_woocommerce_active() && is_shop() && is_active_sidebar('shop');
        if (!is_active_sidebar('sidebar-1') && !$wc_shop_sidebar) {
            $classes[] = 'no-sidebar';
        } else {
            $classes[] = 'has-sidebar';
        }
    }
    if (wp_is_mobile()) {
        $classes[] = 'so-vantage-mobile-device';
    }
    $mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
    if (siteorigin_setting('navigation_menu_search') && !$mega_menu_active) {
        $classes[] = 'has-menu-search';
    }
    if (siteorigin_setting('layout_force_panels_full')) {
        $classes[] = 'panels-style-force-full';
    }
    return $classes;
}
Example #2
0
 /**
  * Adds custom classes to the array of body classes.
  *
  * @since vantage 1.0
  */
 function vantage_body_classes($classes)
 {
     // Adds a class of group-blog to blogs with more than 1 published author
     if (is_multi_author()) {
         $classes[] = 'group-blog';
     }
     if (siteorigin_setting('layout_responsive')) {
         $classes[] = 'responsive';
     }
     $classes[] = 'layout-' . siteorigin_setting('layout_bound');
     $classes[] = 'no-js';
     $is_full_width_template = is_page_template('templates/template-full.php') || is_page_template('templates/template-full-notitle.php');
     if (!$is_full_width_template) {
         $wc_shop_sidebar = vantage_is_woocommerce_active() && is_shop() && is_active_sidebar('shop');
         if (!is_active_sidebar('sidebar-1') && !$wc_shop_sidebar) {
             $classes[] = 'no-sidebar';
         } else {
             $classes[] = 'has-sidebar';
         }
     }
     if (is_customize_preview()) {
         $classes[] = 'so-vantage-customizer-preview';
     }
     if (wp_is_mobile()) {
         $classes[] = 'so-vantage-mobile-device';
     }
     $mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
     if (siteorigin_setting('navigation_menu_search') && !$mega_menu_active) {
         $classes[] = 'has-menu-search';
     }
     if (siteorigin_setting('layout_force_panels_full')) {
         $classes[] = 'panels-style-force-full';
     }
     $page_settings = siteorigin_page_setting();
     if (!empty($page_settings)) {
         if (!empty($page_settings['layout'])) {
             $classes[] = 'page-layout-' . $page_settings['layout'];
         }
         if (empty($page_settings['masthead_margin'])) {
             $classes[] = 'page-layout-no-masthead-margin';
         }
         if (empty($page_settings['footer_margin'])) {
             $classes[] = 'page-layout-no-footer-margin';
         }
         if (!empty($page_settings['hide_masthead'])) {
             $classes[] = 'page-layout-hide-masthead';
         }
         if (!empty($page_settings['hide_footer_widgets'])) {
             $classes[] = 'page-layout-hide-footer-widgets';
         }
     }
     if (is_page() && is_page_template()) {
         $classes[] = 'not-default-page';
     }
     return $classes;
 }
Example #3
0
function vantage_premium_setup()
{
    if (siteorigin_setting('social_ajax_comments')) {
        siteorigin_ajax_comments_activate();
    }
    if (siteorigin_setting('social_share_post')) {
        siteorigin_share_activate();
    }
    $mega_menu_active = function_exists('ubermenu') || function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
    if (siteorigin_setting('navigation_responsive_menu') && !$mega_menu_active) {
        include get_template_directory() . '/premium/extras/mobilenav/mobilenav.php';
    }
    // Add the snippets folder to the custom CSS editor
    if (class_exists('SiteOrigin_CSS')) {
        SiteOrigin_CSS::single()->register_snippet_path(get_template_directory() . '/premium/snippets/');
    } else {
        if (function_exists('siteorigin_custom_css_register_snippet_path')) {
            siteorigin_custom_css_register_snippet_path(get_template_directory() . '/premium/snippets/');
        }
    }
}
Example #4
0
<?php

/**
 * Part Name: Default Menu
 */
$ubermenu_active = function_exists('ubermenu');
$max_mega_menu_active = function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
$nav_classes = array('site-navigation');
if (!$ubermenu_active && !$max_mega_menu_active) {
    $nav_classes[] = 'main-navigation';
}
$nav_classes[] = 'primary';
if (siteorigin_setting('navigation_use_sticky_menu')) {
    $nav_classes[] = 'use-sticky-menu';
}
if (siteorigin_setting('navigation_mobile_navigation')) {
    $nav_classes[] = 'mobile-navigation';
}
$logo_in_menu = siteorigin_setting('layout_masthead') == 'logo-in-menu';
?>

<nav role="navigation" class="<?php 
echo implode(' ', $nav_classes);
?>
">

	<div class="full-container">
		<?php 
if ($logo_in_menu) {
    ?>
			<a href="<?php 
Example #5
0
    function majale_primary_navigation()
    {
        if (function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary')) {
            ?>
			<div class="main-navigation-container">
				<nav class="main-navigation max-width center-block">
					<?php 
            wp_nav_menu(array('theme_location' => 'primary'));
            ?>
				</nav>
			</div>

		<?php 
        } else {
            ?>
			<div class="main-navigation-container">
				<nav class="main-navigation">
					<?php 
            $majale_menu = wp_nav_menu(array('menu' => 'Main Navigation', 'container_id' => 'cssmenu', 'theme_location' => 'primary', 'walker' => new CSS_Menu_Maker_Walker(), 'echo' => FALSE, 'fallback_cb' => '__return_false'));
            if (empty($majele_menu)) {
                echo $majale_menu;
            }
            ?>
				</nav><!-- .main-navigation -->
			<nav class="mobile-navigation">
		<?php 
            $majale_menu = wp_nav_menu(array('menu' => 'Main Navigation', 'theme_location' => 'primary', 'echo' => FALSE, 'fallback_cb' => '__return_false'));
            if (empty($majele_menu)) {
                echo $majale_menu;
            }
            ?>
			</nav><!-- .mobile-navigation -->
		</div>
		<?php 
        }
    }
Example #6
0
 /**
  * Sets up theme defaults and registers support for various WordPress features.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * @since vantage 1.0
  */
 function vantage_setup()
 {
     // Make the theme translatable
     load_theme_textdomain('vantage', get_template_directory() . '/languages');
     // Add default posts and comments RSS feed links to head
     add_theme_support('automatic-feed-links');
     // Enable support for Post Thumbnails
     add_theme_support('post-thumbnails');
     add_theme_support('siteorigin-panels', array('home-page' => true, 'margin-bottom' => 35, 'home-page-default' => 'default-home', 'home-demo-template' => 'home-panels.php', 'responsive' => siteorigin_setting('layout_responsive')));
     // This theme uses wp_nav_menu() in one location.
     register_nav_menus(array('primary' => __('Primary Menu', 'vantage')));
     // Enable support for Post Formats
     add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));
     // We support WooCommerce
     add_theme_support('woocommerce');
     set_post_thumbnail_size(720, 380, true);
     add_image_size('vantage-thumbnail-no-sidebar', 1080, 380, true);
     add_image_size('vantage-slide', 960, 480, true);
     add_image_size('vantage-carousel', 272, 182, true);
     add_image_size('vantage-grid-loop', 436, 272, true);
     add_theme_support('custom-logo');
     add_theme_support('title-tag');
     if (!defined('SITEORIGIN_PANELS_VERSION')) {
         // Only include panels lite if the panels plugin doesn't exist
         include get_template_directory() . '/inc/panels-lite/panels-lite.php';
     }
     global $content_width, $vantage_site_width;
     if (!isset($content_width)) {
         $content_width = 720;
     }
     /* pixels */
     if (!isset($vantage_site_width)) {
         $vantage_site_width = siteorigin_setting('layout_bound') == 'full' ? 1080 : 1010;
     }
     $container = 'content';
     $render_function = '';
     $wrapper = true;
     // The posts_per_page setting only works when type is 'scroll'.
     // When type is set to 'click' either explicitly or automatically,
     // due to there being footer widgets, it uses the "Blog pages show at most X posts" setting
     // under Settings > Reading instead. :(
     // https://wordpress.org/support/topic/posts_per_page-not-having-any-effect
     $posts_per_page = 7;
     if (siteorigin_setting('blog_archive_layout') == 'circleicon') {
         $container = 'vantage-circleicon-loop';
         $render_function = 'vantage_infinite_scroll_render';
         $wrapper = false;
         $posts_per_page = 6;
     } else {
         if (siteorigin_setting('blog_archive_layout') == 'grid') {
             $container = 'vantage-grid-loop';
             $render_function = 'vantage_infinite_scroll_render';
             $wrapper = false;
             $posts_per_page = 8;
         }
     }
     add_filter('infinite_scroll_settings', 'vantage_infinite_scroll_settings');
     // Allowing use of shortcodes in taxonomy descriptions
     add_filter('term_description', 'shortcode_unautop');
     add_filter('term_description', 'do_shortcode');
     add_theme_support('infinite-scroll', array('container' => $container, 'footer' => 'page', 'render' => $render_function, 'wrapper' => $wrapper, 'posts_per_page' => $posts_per_page, 'type' => 'click'));
     $mega_menu_active = function_exists('ubermenu') || function_exists('max_mega_menu_is_enabled') && max_mega_menu_is_enabled('primary');
     if (siteorigin_setting('navigation_responsive_menu') && !$mega_menu_active) {
         include get_template_directory() . '/inc/mobilenav/mobilenav.php';
     }
     // We'll use template settings
     add_theme_support('siteorigin-template-settings');
 }