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');
// 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' )
) );
// Add custom header support
$header_defaults = array(
'default-image' => get_template_directory_uri() . '/img/header.png',
'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
// Remove double spaces
function remove_spaces($the_content) {
return preg_replace( '/[\p{Z}\s]{2,}/u', ' ', $the_content );
}
add_filter('the_content', 'remove_spaces');
// Make so null search does not take user back to home page
function my_request_filter( $query_vars ) {
if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) {
$query_vars['s'] = " ";
}
return $query_vars;
}
add_filter( 'request', 'my_request_filter' );
?>