get( 'Version' ) ); /* * Setup and registration functions */ function blackoot_setup(){ /* Translation support * Translations can be added to the /languages directory. * A .pot template file is included to get you started */ load_theme_textdomain('blackoot-lite', THEME_DIR . '/languages'); // Content Width global $content_width; if ( ! isset( $content_width ) ) $content_width = 680; /* Feed links support */ add_theme_support( 'automatic-feed-links' ); /* Register menus */ register_nav_menu( 'primary', 'Navigation menu' ); register_nav_menu( 'footer-menu', 'Footer menu' ); /* Title tag support */ add_theme_support( 'title-tag' ); /* Post Thumbnails Support */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 680, 300, true ); /* Custom header support */ add_theme_support( 'custom-header', array( 'header-text' => false, 'width' => 1000, 'height' => 364, 'flex-height' => true, ) ); /* Custom background support */ add_theme_support( 'custom-background', array( 'default-color' => '111111', 'default-image' => THEME_DIR_URI . '/img/zwartevilt.png', ) ); /* Support HTML5 Search Form */ add_theme_support( 'html5', array( 'search-form' ) ); } add_action('after_setup_theme', 'blackoot_setup'); /* Adjust $content_width depending on the page being displayed */ function blackoot_content_width() { global $content_width; if ( is_page_template( 'page-full-width.php' ) ) $content_width = 920; } add_action( 'template_redirect', 'blackoot_content_width' ); /* * Add a home link to wp_page_menu() ( wp_nav_menu() fallback ) */ function blackoot_page_menu_args( $args ) { if ( ! isset( $args['show_home'] ) ) $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'blackoot_page_menu_args' ); /* * Add parent Class to parent menu items */ function blackoot_add_menu_parent_class( $items ) { $parents = array(); foreach ( $items as $item ) { if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) { $parents[] = $item->menu_item_parent; } } foreach ( $items as $item ) { if ( in_array( $item->ID, $parents ) ) { $item->classes[] = 'menu-parent-item'; } } return $items; } add_filter( 'wp_nav_menu_objects', 'blackoot_add_menu_parent_class' ); /* * Register Sidebar and Footer widgetized areas */ function blackoot_widgets_init() { register_sidebar( array( 'name' => __( 'Default Sidebar', 'blackoot-lite' ), 'id' => 'sidebar', 'before_title' => '