'fff',
);
add_theme_support( 'custom-background', $args );
// Load text domain path.
load_theme_textdomain( 'bootstrap-canvas-wp', get_template_directory() . '/languages' );
// Register primary navigation menu.
register_nav_menu( 'primary', 'Primary Menu' );
// Register custom navigation walker.
require_once('inc/wp_bootstrap_navwalker.php');
}
add_action( 'after_setup_theme', 'bootstrap_canvas_wp_setup' );
/**
* Register main sidebar.
*/
function bootstrap_canvas_wp_sidebar_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'bootstrap-canvas-wp' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages except the optional "Full-width Page Template, No Sidebar"', 'bootstrap-canvas-wp' ),
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'bootstrap_canvas_wp_sidebar_widgets_init' );
/**
* Add support for a custom header image.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Add empty search query filter.
*/
function bootstrap_canvas_wp_empty_search_filter($query) {
// If 's' request variable is set but empty.
if (isset($_GET['s']) && empty($_GET['s']) && $query->is_main_query()){
$query->is_search = true;
$query->is_home = false;
}
return $query;}
add_filter('pre_get_posts','bootstrap_canvas_wp_empty_search_filter');
/**
* Add custom editor stylesheet.
*/
function bootstrap_canvas_wp_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'init', 'bootstrap_canvas_wp_add_editor_styles' );
/**
* Link all thumbnails to post.
*/
function bootstrap_canvas_wp_post_image_html( $html, $post_id, $post_image_id ) {
$html = '' . $html . '';
return $html;
}
add_filter( 'post_thumbnail_html', 'bootstrap_canvas_wp_post_image_html', 10, 3 );
/**
* Change exceprt length to 20 words.
*/
function bootstrap_canvas_wp_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'bootstrap_canvas_wp_excerpt_length', 999 );
/**
* Change exceprt more string.
*/
function bootstrap_canvas_wp_excerpt_more( $more ) {
return '...';
}
add_filter('excerpt_more', 'bootstrap_canvas_wp_excerpt_more');
/**
* Disable comments-reply javascript in header.
*/
function clean_header(){
wp_deregister_script( 'comment-reply' );
}
add_action('init','clean_header');
?>