tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'bd_blog_image', 900,414, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'bangladesh' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'bangladesh_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif;
add_action( 'after_setup_theme', 'bangladesh_setup' );
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function bangladesh_content_width() {
$GLOBALS['content_width'] = apply_filters( 'bangladesh_content_width', 640 );
}
add_action( 'after_setup_theme', 'bangladesh_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function bangladesh_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'bangladesh' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
}
add_action( 'widgets_init', 'bangladesh_widgets_init' );
/**
* Google font For Bangladesh theme
*/
function bangladesh_google_fonts_url() {
$font_url = '';
/* Translators: If there are characters in your language that are not
* supported by Roboto+Slab, translate this to 'off'. Do not translate
* into your own language.
*/
$lato = _x( 'on', 'Lato font: on or off', 'bangladesh' );
/* Translators: If there are characters in your language that are not
* supported by lato, translate this to 'off'. Do not translate
* into your own language.
*/
$open_sans = _x( 'on', 'Open Sans font: on or off', 'bangladesh' );
/* Translators: If there are characters in your language that are not
* supported by Open Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$lato = _x( 'on', 'lato font: on or off', 'bangladesh' );
if ( 'off' !== $lato || 'off' !== $open_sans ) {
$font_families = array();
if ( 'off' !== $lato ) {
$font_families[] = 'Lato:400,700,300';
}
if ( 'off' !== $open_sans ) {
$font_families[] = 'Open Sans:400,300,600,700';
}
$query_args = array(
'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}
return esc_url_raw( $fonts_url );
}
/**
* Enqueue scripts and styles.
*/
function bangladesh_scripts() {
// Add Google Fonts css
wp_enqueue_style( 'google-fonts', bangladesh_google_fonts_url(), array(), null );
//Load CSS Files
wp_enqueue_style( 'bootstrap', get_template_directory_uri(). '/css/bootstrap.css' );
wp_enqueue_style( 'stylesheet', get_stylesheet_uri() );
wp_enqueue_style( 'responsive', get_template_directory_uri(). '/css/responsive.css' );
/**
* IE 9
*/
// Load the html5shiv.
wp_enqueue_script( 'html5shiv', get_template_directory_uri() . '/js/html5shiv.min.js', array(), '3.7.8' );
wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' );
// Load the respond.
wp_enqueue_script( 'respond', get_template_directory_uri() . '/js/respond.min.js', array(), '3.7.4' );
wp_script_add_data( 'respond', 'conditional', 'lt IE 9' );
// Load the polyfill.
wp_enqueue_script( 'polyfill', get_template_directory_uri() . '/js/ie-opacity-polyfill.js', array(), '3.7.5' );
wp_script_add_data( 'polyfill', 'conditional', 'lt IE 8' );
//Load JS Files
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'), '3.3', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'bangladesh_scripts' );
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
/**
* Load wp_bootstrap_navwalker file.
*/
require get_template_directory() . '/inc/wp_bootstrap_navwalker.php';
// comment list modify
function bangladesh_comments($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="comment-">
Leave a Reply','bangladesh');
$arg['comment_field'] = '';
return $arg;
}
add_filter('comment_form_defaults','bangladesh_comment_reform');
// comment form modify
function bangladesh_modify_comment_form_fields($fields){
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$fields['author'] = '';
return $fields;
}
add_filter('comment_form_default_fields','bangladesh_modify_comment_form_fields');