max_num_pages < 2 ) {
return;
}
?>
'Sidebar Widgets',
'id' => 'sidebar-widgets',
'description' => 'Drag widget for the sidebar here',
'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',
'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' );
// 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
// 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' );