Пример #1
0
 function nm_vc_register_elements()
 {
     global $nm_cf7_enabled;
     include NM_VC_DIR . '/elements/banner.php';
     include NM_VC_DIR . '/elements/banner-slider.php';
     include NM_VC_DIR . '/elements/button.php';
     if ($nm_cf7_enabled) {
         include NM_VC_DIR . '/elements/contact-form-7.php';
     }
     include NM_VC_DIR . '/elements/feature-box.php';
     include NM_VC_DIR . '/elements/google-map.php';
     include NM_VC_DIR . '/elements/lightbox.php';
     include NM_VC_DIR . '/elements/post-slider.php';
     include NM_VC_DIR . '/elements/social-profiles.php';
     include NM_VC_DIR . '/elements/testimonial.php';
     if (nm_woocommerce_activated()) {
         // Include external WooCommerce elements
         include NM_VC_DIR . '/elements/woocommerce/product-categories.php';
         //todo: include( NM_VC_DIR . '/elements/woocommerce/product-slider.php' );
     }
 }
Пример #2
0
    ?>
							
							<?php 
    // Top-bar menu
    wp_nav_menu(array('theme_location' => 'top-bar-menu', 'container' => false, 'menu_id' => 'nm-top-menu', 'fallback_cb' => false, 'items_wrap' => '<ul id="%1$s" class="nm-menu">%3$s</ul>'));
    ?>
                        </div>
                    </div>                
                </div>
                <!-- /top bar -->
                <?php 
}
?>
                            
                <div class="nm-page-wrap-inner">
                
                    <div id="nm-header-placeholder" class="nm-header-placeholder"></div>
                            
                    <?php 
$header_layout = isset($_GET['header']) ? $_GET['header'] : $nm_theme_options['header_layout'];
if ($header_layout == 'default') {
    // Include default header
    get_header('default');
} else {
    // Include centered header
    get_header('centered');
}
if (nm_woocommerce_activated() && is_account_page()) {
    // Include login header
    get_header('login');
}
Пример #3
0
                                    <?php 
    echo nm_get_cart_contents_count();
    ?>
                                </a>
                            </li>
                            <?php 
}
if ($nm_globals['header_shop_search']) {
    ?>
                            <li class="nm-menu-search menu-item"><a href="#" id="nm-menu-search-btn"><i class="nm-font nm-font-search-alt flip"></i></a></li>
                            <?php 
}
?>
                            <li class="nm-menu-offscreen menu-item">
                                <?php 
if (nm_woocommerce_activated()) {
    echo nm_get_cart_contents_count();
}
?>
                                
                                <a href="#" id="nm-slide-menu-button" class="clicked">
                                    <div class="nm-menu-icon">
                                        <span class="line-1"></span><span class="line-2"></span><span class="line-3"></span>
                                    </div>
								</a>
                            </li>
                        </ul>
                    </nav>
                	
                    <?php 
echo $ubermenu_wrap_close;
Пример #4
0
function nm_scripts()
{
    if (!is_admin()) {
        global $nm_theme_options, $nm_globals, $nm_page_includes;
        // Script path and suffix setup (debug mode loads un-minified scripts)
        if (defined('NM_SCRIPT_DEBUG') && NM_SCRIPT_DEBUG) {
            $script_path = NM_THEME_URI . '/js/dev/';
            $suffix = '';
        } else {
            $script_path = NM_THEME_URI . '/js/';
            $suffix = '.min';
        }
        // Enqueue scripts
        wp_enqueue_script('modernizr', NM_THEME_URI . '/js/plugins/modernizr.min.js', array('jquery'), '2.8.3');
        wp_enqueue_script('unveil', NM_THEME_URI . '/js/plugins/jquery.unveil.min.js', array('jquery'), '1.0');
        wp_enqueue_script('slick-slider', NM_THEME_URI . '/js/plugins/slick.min.js', array('jquery'), '1.5.5');
        wp_enqueue_script('magnific-popup', NM_THEME_URI . '/js/plugins/jquery.magnific-popup.min.js', array('jquery'), '0.9.9');
        wp_enqueue_script('nm-core', $script_path . 'nm-core' . $suffix . '.js', array('jquery'), NM_THEME_VERSION);
        // Enqueue blog-grid scripts
        if (isset($nm_page_includes['blog-grid'])) {
            wp_enqueue_script('packery', NM_THEME_URI . '/js/plugins/packery.pkgd.min.js', array(), '1.3.2', true);
        }
        // WP comments script
        if (is_singular() && comments_open() && get_option('thread_comments')) {
            wp_enqueue_script('comment-reply');
        }
        // Enqueue "Contact form 7" scripts
        if (isset($nm_page_includes['contact-form-7'])) {
            wpcf7_enqueue_scripts();
        }
        if (nm_woocommerce_activated()) {
            // Register shop/product scripts
            wp_register_script('selectod', NM_THEME_URI . '/js/plugins/selectod.custom.min.js', array('jquery'), '3.8.1');
            wp_register_script('nm-shop-add-to-cart', $script_path . 'nm-shop-add-to-cart' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
            wp_register_script('nm-shop', $script_path . 'nm-shop' . $suffix . '.js', array('jquery', 'nm-core', 'selectod'), NM_THEME_VERSION);
            wp_register_script('wc-add-to-cart-variation', NM_THEME_URI . '/js/woocommerce/add-to-cart-variation.min.js', array('jquery'), '2.x', true);
            // Needed for variation product quick views
            wp_register_script('nm-shop-quickview', $script_path . 'nm-shop-quickview' . $suffix . '.js', array('jquery', 'nm-shop', 'wc-add-to-cart-variation'), NM_THEME_VERSION);
            // Enqueue shop/product scripts
            if (isset($nm_page_includes['products'])) {
                wp_enqueue_script('selectod');
                wp_enqueue_script('nm-shop-add-to-cart');
                if ($nm_theme_options['product_quickview']) {
                    wp_enqueue_script('wc-add-to-cart-variation');
                    // Needed for variation product quick views
                    wp_enqueue_script('nm-shop-quickview');
                }
            } else {
                if (isset($nm_page_includes['wishlist-home'])) {
                    wp_enqueue_script('nm-shop-add-to-cart');
                }
            }
            // Register shop scripts
            wp_register_script('nm-shop-infload', $script_path . 'nm-shop-infload' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
            wp_register_script('nm-shop-filters', $script_path . 'nm-shop-filters' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
            wp_register_script('nm-shop-search', $script_path . 'nm-shop-search' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
            // WooCommerce page - Note: Does not include the Cart, Checkout or Account pages
            if (is_woocommerce()) {
                // Single product page
                if (is_product()) {
                    // Single product page: Modal gallery
                    if ($nm_theme_options['product_image_zoom']) {
                        wp_enqueue_script('photoswipe', NM_THEME_URI . '/js/plugins/photoswipe.min.js', array('jquery'), '4.0.0');
                        wp_enqueue_script('photoswipe-ui', NM_THEME_URI . '/js/plugins/photoswipe-ui-default.min.js', array('jquery'), '4.0.0');
                    }
                    // Single product page: Hover image-zoom
                    if ($nm_globals['product_image_hover_zoom']) {
                        wp_enqueue_script('easyzoom', NM_THEME_URI . '/js/plugins/easyzoom.min.js', array('jquery'), '2.3.0');
                    }
                    wp_enqueue_script('nm-shop-add-to-cart');
                    wp_enqueue_script('nm-shop-single-product', $script_path . 'nm-shop-single-product' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
                } else {
                    wp_enqueue_script('smartscroll', NM_THEME_URI . '/js/plugins/jquery.smartscroll.min.js', array('jquery'), '1.0');
                    wp_enqueue_script('nm-shop-infload');
                    wp_enqueue_script('nm-shop-filters');
                    if ($nm_globals['shop_filters_scrollbar_custom']) {
                        wp_enqueue_script('nm-shop-filters-scrollbar', $script_path . 'nm-shop-filters-scrollbar' . $suffix . '.js', array('jquery', 'nm-shop-filters'), NM_THEME_VERSION);
                    }
                    wp_enqueue_script('nm-shop-search');
                }
            } else {
                // Cart page
                if (is_cart()) {
                    wp_enqueue_script('nm-shop-cart', $script_path . 'nm-shop-cart' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
                } else {
                    if (is_checkout()) {
                        wp_enqueue_script('nm-shop-checkout', $script_path . 'nm-shop-checkout' . $suffix . '.js', array('jquery', 'nm-shop'), NM_THEME_VERSION);
                    } else {
                        if (is_account_page()) {
                            wp_enqueue_script('nm-shop-myaccount', $script_path . 'nm-shop-myaccount' . $suffix . '.js', array('jquery'), NM_THEME_VERSION);
                        }
                    }
                }
            }
        }
        // Add local Javascript variables
        $local_js_vars = array('themeDir' => NM_THEME_DIR, 'themeUri' => NM_THEME_URI, 'ajaxUrl' => admin_url('admin-ajax.php'), 'searchUrl' => home_url('?s='), 'shopFiltersAjax' => isset($_GET['ajax_filters']) ? esc_attr($_GET['ajax_filters']) : esc_attr($nm_theme_options['shop_filters_enable_ajax']), 'shopFilterScrollbars' => $nm_globals['shop_filters_scrollbar_custom'] ? 1 : 0, 'shopImageLazyLoad' => intval($nm_theme_options['product_image_lazy_loading']), 'shopScrollOffset' => intval($nm_theme_options['shop_scroll_offset']), 'shopSearch' => esc_attr($nm_globals['shop_search_layout']), 'shopSearchMinChar' => intval($nm_theme_options['shop_search_min_char']), 'shopAjaxAddToCart' => get_option('woocommerce_enable_ajax_add_to_cart') == 'yes' && get_option('woocommerce_cart_redirect_after_add') == 'no' ? 1 : 0);
        wp_localize_script('nm-core', 'nm_wp_vars', $local_js_vars);
    }
}
                            <?php 
    wp_nav_menu(array('theme_location' => 'main-menu', 'container' => false, 'fallback_cb' => false, 'items_wrap' => '%3$s'));
    ?>
                        </ul>
                    </nav>
                    <?php 
}
?>
                </div>
                
                <div class="nm-right-menu-wrap col-xs-6">
                    <nav class="nm-right-menu">
                        <ul id="nm-right-menu-ul" class="nm-menu">
                            <?php 
wp_nav_menu(array('theme_location' => 'right-menu', 'container' => false, 'fallback_cb' => false, 'items_wrap' => '%3$s'));
if (nm_woocommerce_activated() && $nm_theme_options['menu_login']) {
    ?>
                            <li class="nm-menu-account menu-item">
                            	<?php 
    echo nm_get_myaccount_link(true);
    ?>
							</li>
							<?php 
}
if ($nm_globals['cart_link']) {
    $cart_url = $nm_globals['cart_panel'] ? '#' : WC()->cart->get_cart_url();
    ?>
                            <li class="nm-menu-cart menu-item">
                                <a href="<?php 
    echo esc_url($cart_url);
    ?>