250,
'height' => 250,
'flex-width' => true,
) );
add_theme_support( 'custom-background', array(
'default-color' => 'ffffff'
) );
add_theme_support( 'html5', array('comment-form','comment-list','gallery','caption',) );
add_editor_style( array( 'assets/css/editor-style.css') );
}
/**
* Register widget area.
*/
function bookstore_library_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'bookstore-library' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'bookstore-library' ),
'id' => 'sidebar-2',
'description' => __( 'Add widgets here to appear in your sidebar on pages.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'bookstore-library' ),
'id' => 'sidebar-3',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'bookstore-library' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'bookstore-library' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'bookstore-library' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 4', 'bookstore-library' ),
'id' => 'footer-4',
'description' => __( 'Add widgets here to appear in your footer.', 'bookstore-library' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'bookstore_library_widgets_init' );
// enqueue styles for child theme
function bookstore_library_enqueue_styles() {
wp_enqueue_style( 'bookstore-library-fonts', author_writer_fonts_url(), array(), null );
// Bootstrap
wp_enqueue_style( 'bootstrap-css', get_theme_file_uri( '/assets/css/bootstrap.css' ) );
// owl-carousel
wp_enqueue_style( 'owl-carousel-css', get_theme_file_uri( '/assets/css/owl.carousel.css' ) );
// Theme block stylesheet.
wp_enqueue_style( 'bookstore-library-block-style', get_theme_file_uri( '/assets/css/blocks.css' ), array( 'bookstore-library-child-style' ), '1.0' );
// enqueue parent styles
wp_enqueue_style('author-writer-style', get_template_directory_uri() .'/style.css');
// enqueue child styles
wp_enqueue_style('bookstore-library-child-style', get_stylesheet_directory_uri() .'/style.css', array('author-writer-style'));
wp_enqueue_script('owl.carousel-js', esc_url( get_theme_file_uri() ) . '/assets/js/owl.carousel.js',array('jquery'),'2.3.4', TRUE);
wp_enqueue_script('bookstore-library-custom-js', esc_url( get_theme_file_uri() ) . '/assets/js/bookstore-library-custom.js',array('jquery'),'2.3.4',TRUE
);
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
add_action('wp_enqueue_scripts', 'bookstore_library_enqueue_styles');
function bookstore_library_admin_scripts() {
// Backend CSS
wp_enqueue_style( 'bookstore-library-backend-css', get_theme_file_uri( '/assets/css/customizer.css' ) );
}
add_action( 'admin_enqueue_scripts', 'bookstore_library_admin_scripts' );
function bookstore_library_header_style() {
if ( get_header_image() ) :
$bookstore_library_custom_header = "
.headerbox{
background-image:url('".esc_url(get_header_image())."');
background-position: center top;
}";
wp_add_inline_style( 'bookstore-library-child-style', $bookstore_library_custom_header );
endif;
}
add_action( 'wp_enqueue_scripts', 'bookstore_library_header_style' );
// Latest Event Meta
function bookstore_library_bn_custom_meta_featured() {
add_meta_box( 'bn_meta', __( 'Latest Events Meta Feilds', 'bookstore-library' ), 'bookstore_library_meta_callback_workshop_event', 'post', 'normal', 'high' );
}
/* Hook things in for admin*/
if (is_admin()){
add_action('admin_menu', 'bookstore_library_bn_custom_meta_featured');
}
function bookstore_library_meta_callback_workshop_event( $post ) {
wp_nonce_field( basename( __FILE__ ), 'bookstore_library_workshop_event_meta_nonce' );
$bn_stored_meta = get_post_meta( $post->ID );
$event_category = get_post_meta( $post->ID, 'bookstore_library_event_category', true );
$event_location = get_post_meta( $post->ID, 'bookstore_library_event_location', true );
?>
".esc_html__('Bookstore Library WordPress Theme','bookstore-library')."";
}
}