max_num_pages < 2 ) { return; } ?> 'Sidebar Widgets', 'id' => 'sidebar-widgets', 'description' => __('Drag widget for the sidebar here','a11yall'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar( array( 'name' => 'Page Sidebar', 'id' => 'page-widgets', 'description' => __('Drag to create or update the sidebar for pages','a11yall'), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); } add_action( 'widgets_init', 'a11yall_widgets_init' ); // Start Theme Setup. // Run a11yall_themesetup() to make various things possible when the 'after_setup_theme' hook is run. add_action('after_setup_theme', 'a11yall_themesetup'); function a11yall_themesetup() { // Styling the visual admin editor to resemble the theme style add_editor_style( 'css/editor-style.css'); global $content_width; // Set oEmbed max width for things like videos if ( ! isset( $content_width ) ) { $content_width = 600; /* pixels */ } // Make theme available for translation // Translations can be filed in the /languages/ directory. load_theme_textdomain( 'a11yall', get_template_directory() . '/languages' ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Setup the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'a11yall_custom_background_args', array( 'default-color' => 'dddddd', 'default-image' => '', ) ) ); // Set up Featured Images (formerly known as post thumbnails) add_theme_support( 'post-thumbnails' ); // Adding title tag theme support per https://make.wordpress.org/core/2014/10/29/title-tags-in-4-1/ add_theme_support( 'title-tag' ); // Register menus register_nav_menus( array( 'primary' => __( 'Main Menu', 'a11yall' ), 'secondary' => __( 'Footer Menu', 'a11yall' ) ) ); register_default_headers( array( 'wheel' => array( 'url' => '%s/img/header.png', 'thumbnail_url' => '%s/img/header.png', 'description' => __( 'Pinwheel', 'a11yall' ) ), 'dancing-flower-aqua' => array( 'url' => '%s/img/dancing-flower-aqua.png', 'thumbnail_url' => '%s/img/dancing-flower-aqua.png', 'description' => __( 'Aqua Dancing Flower', 'a11yall' ) ), 'dancing-flower-terracotta' => array( 'url' => '%s/img/dancing-flower-terracotta.png', 'thumbnail_url' => '%s/img/dancing-flower-terracotta.png', 'description' => __( 'Terra Dancing Flower', 'a11yall' ) ) ) ); // Add custom header support $header_defaults = array( 'default-image' => '', 'random-default' => false, 'width' => 125, 'height' => 125, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => false, 'uploads' => true ); add_theme_support( 'custom-header', $header_defaults ); } // End Theme Setup // Improve SEO on title tag in case don't use plugin // Note of Jan. 2015: with WP 4.1 addition of add_theme_support( 'title-tag' ), this no longer functions fully // Holding to review once dust settles about this function /*function a11yall_wp_title( $title ) { global $page, $paged; if ( is_feed() ) return $title; if ( is_home() || is_front_page() ) { $filtered_title = get_bloginfo( 'name' ) . ' - ' . get_bloginfo('description'); } else { $filtered_title = $title . ' - ' . get_bloginfo( 'name' ); $filtered_title .= ( 2 <= $paged || 2 <= $page ) ? ' - ' . sprintf( __( 'Page %s', 'a11yall' ), max( $paged, $page ) ) : ''; } return $filtered_title; } add_filter( 'wp_title', 'a11yall_wp_title' );*/ // For primary menu, create fallback with just 1 level depth for function a11yall_primary_menu_fallback() { echo ''; } // Remove double spaces function a11yall_remove_spaces($the_content) { return preg_replace( '/[\p{Z}\s]{2,}/u', ' ', $the_content ); } add_filter('the_content', 'a11yall_remove_spaces'); // Make so null search does not take user back to home page function a11yall_my_request_filter( $query_vars ) { if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { $query_vars['s'] = " "; } return $query_vars; } add_filter( 'request', 'a11yall_my_request_filter' );