__( 'Primary Menu', 'bbird-under' ), 'mobile-off-canvas' => __( 'Mobile', 'bbird-under' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * Enable support for Post Formats. * See http://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'bbird_under_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Declare WooCommerce Support add_theme_support( 'woocommerce' ); } endif; // bbird_under_setup add_action( 'after_setup_theme', 'bbird_under_setup' ); /** * Register widget areas. */ function bbird_under_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'bbird-under' ), 'id' => 'sidebar-right', 'description' => '', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'WooCommerce Sidebar', 'bbird-under' ), 'id' => 'woocommerce_sidebar', 'description' => __( 'Widgets for WooCommerce page templates', 'bbird-under' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); $args = array( 'id' => 'footer-1', 'name' => __( 'First Footer Sidebar', 'bbird-under' ), 'description' => __( 'Widgets for first footer column', 'bbird-under' ), 'before_title' => '', 'before_widget' => '' ); register_sidebar( $args ); $args = array( 'id' => 'footer-2', 'name' => __( 'Second Footer Sidebar', 'bbird-under' ), 'description' => __( 'Widgets for second footer column', 'bbird-under' ), 'before_title' => '', 'before_widget' => '' ); register_sidebar( $args ); $args = array( 'id' => 'footer-3', 'name' => __( 'Third Footer Sidebar', 'bbird-under' ), 'description' => __( 'Widgets for third footer column', 'bbird-under' ), 'before_title' => '', 'before_widget' => '' ); register_sidebar( $args ); $args = array( 'id' => 'footer-4', 'name' => __( 'Fourth Footer Sidebar', 'bbird-under' ), 'description' => __( 'Widgets for fourth footer column', 'bbird-under' ), 'before_title' => '', 'before_widget' => '' ); register_sidebar( $args ); } add_action( 'widgets_init', 'bbird_under_widgets_init' ); /** * Enqueue scripts and styles. */ function bbird_under_scripts() { wp_enqueue_style( 'font-awseome', get_template_directory_uri().'/css/font-awesome.min.css' ); wp_enqueue_style( 'foundation', get_template_directory_uri().'/css/foundation.css' ); wp_enqueue_style( 'normalize', get_template_directory_uri().'/css/normalize.css' ); wp_enqueue_style( 'bbird-under-style', get_stylesheet_uri() ); wp_enqueue_script( 'ui-scripts', get_template_directory_uri() . '/js/uiscripts.js', array('jquery')); wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/vendor/modernizr.js', array(), '', false ); wp_enqueue_script( 'fastclick', get_template_directory_uri() . '/js/vendor/fastclick.js', array(), '', false ); wp_enqueue_script( 'foundation', get_template_directory_uri() . '/js/foundation.min.js', array('jquery'), '', true ); wp_enqueue_script( 'loadiframe', get_stylesheet_directory_uri() . '/js/loadiframe.js', array('jquery')); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'bbird_under_scripts' ); /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /** * Custom Walker class for navigation */ class bbird_under_top_bar_walker extends Walker_Nav_Menu { function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { $element->has_children = ! empty( $children_elements[ $element->ID ] ); $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : ''; $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : ''; parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); } function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { $item_html = ''; parent::start_el( $item_html, $object, $depth, $args ); $output .= ( 0 == $depth ) ? '
  • ' : ''; $classes = empty( $object->classes ) ? array() : (array) $object->classes; if ( in_array( 'label', $classes ) ) { $output .= '
  • '; $item_html = preg_replace( '/]*>(.*)<\/a>/iU', '', $item_html ); } if ( in_array( 'divider', $classes ) ) { $item_html = preg_replace( '/]*>( .* )<\/a>/iU', '', $item_html ); } $output .= $item_html; } function start_lvl( &$output, $depth = 0, $args = array() ) { $output .= "\n