esc_html__( 'Main Menu', 'basic-blog' ), ) ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 300, 300, true ); add_image_size( 'basic-blog-archive', 540, 304, true ); add_image_size( 'basic-blog-thumbnail', 120, 90, true ); // Add Custom Background Support. $args = array( 'default-color' => 'ffffff', ); add_theme_support( 'custom-background', $args ); // Add theme support for Custom Header. $custom_header_defaults = array( 'width' => 2000, 'height' => 450, 'flex-width' => true, 'flex-height' => true, 'default-image' => esc_url( get_template_directory_uri() ) .'/img/bg.jpg', 'wp-head-callback' => 'basic_blog_header_style', ); add_theme_support( 'custom-header', $custom_header_defaults ); add_theme_support( 'custom-logo', array( 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); } endif; /** * Set Content Width */ function basic_blog_content_width() { $GLOBALS['content_width'] = apply_filters( 'basic_blog_content_width', 1140 ); } add_action( 'after_setup_theme', 'basic_blog_content_width', 0 ); if ( ! function_exists( 'basic_blog_header_style' ) ) : /** * Styles the header image and text displayed on the blog. * * @see basic_blog_custom_header_setup(). */ function basic_blog_header_style() { $header_text_color = get_header_textcolor(); // If no custom options for text are set, let's bail. // get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value. if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) { return; } // If we get this far, we have custom styles. Let's do this. ?> urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url_raw( $fonts_url ); } /** * Enqueue Styles (normal style.css and bootstrap.css) */ function basic_blog_theme_stylesheets() { // Add custom fonts, used in the main stylesheet. wp_enqueue_style( 'basic-blog-fonts', basic_blog_fonts_url(), array(), null ); wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '3.3.7' ); // Theme stylesheet. wp_enqueue_style( 'basic-blog-stylesheet', get_stylesheet_uri(), array('bootstrap'), '1.0.1' ); // Load Font Awesome css. wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0' ); } add_action( 'wp_enqueue_scripts', 'basic_blog_theme_stylesheets' ); /** * Register Bootstrap JS with jquery */ function basic_blog_theme_js() { wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.7', true ); wp_enqueue_script( 'slick', get_template_directory_uri() . '/js/slick.min.js', array( 'jquery' ), '1.8.1', true ); wp_enqueue_script( 'basic-blog-theme-js', get_template_directory_uri() . '/js/customscript.js', array( 'jquery' ), '1.0.1', true ); } add_action( 'wp_enqueue_scripts', 'basic_blog_theme_js' ); /** * Register Custom Navigation Walker include custom menu widget to use walkerclass */ require_once( trailingslashit( get_template_directory() ) . 'lib/wp_bootstrap_navwalker.php' ); /** * Widgets */ require_once( trailingslashit( get_template_directory() ) . 'includes/widgets.php' ); add_action( 'widgets_init', 'basic_blog_widgets_init' ); /** * Register the Sidebar(s) */ function basic_blog_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Header Section', 'basic-blog' ), 'id' => 'basic-blog-header-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Section before content', 'basic-blog' ), 'id' => 'basic-blog-homepage-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__( 'Right Sidebar', 'basic-blog' ), 'id' => 'basic-blog-right-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Section', 'basic-blog' ), 'id' => 'basic-blog-footer-area', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } function basic_blog_main_content_width_columns() { $columns = '12'; if ( is_active_sidebar( 'basic-blog-right-sidebar' ) ) { $columns = $columns - 3; } echo absint( $columns ); } if ( !function_exists( 'basic_blog_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function basic_blog_entry_footer() { // Get Categories for posts. $categories_list = get_the_category_list( ' ' ); // Get Tags for posts. $tags_list = get_the_tag_list( '', ' ' ); // We don't want to output .entry-footer if it will be empty, so make sure its not. if ( $categories_list || $tags_list || get_edit_post_link() ) { echo '
'; if ( 'post' === get_post_type() ) { if ( $categories_list || $tags_list ) { // Make sure there's more than one category before displaying. if ( $categories_list ) { echo ''; } if ( $tags_list ) { echo ''; } } } edit_post_link(); echo '
'; } } endif; if ( !function_exists( 'basic_blog_generate_construct_footer' ) ) : /** * Build footer */ add_action( 'basic_blog_generate_footer', 'basic_blog_generate_construct_footer' ); function basic_blog_generate_construct_footer() { ?> %2$s', get_permalink( get_the_ID() ), esc_html__( 'Continue Reading', 'basic-blog' ) ); } add_filter( 'excerpt_more', 'basic_blog_excerpt_more' ); endif; if ( ! function_exists( 'basic_blog_excerpt_length' ) ) : /** * Excerpt more. */ function basic_blog_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'basic_blog_excerpt_length' ); endif; if ( ! function_exists( 'basic_blog_thumb_img' ) ) : /** * Returns widget thumbnail. */ function basic_blog_thumb_img( $img = 'full', $col = '', $link = '' ) { if ( has_post_thumbnail() && $link != '' ) { ?>
<?php the_title_attribute(); ?>
<?php the_title_attribute(); ?>