get_stylesheet_directory_uri() .'/images/head-back.jpg', 'width' => '1600', 'height' => '600', 'flex-height' => false, 'flex-width' => false, 'header-text' => true, 'default-text-color' => '#143745' ); add_theme_support( 'custom-header', $args ); } add_action( 'after_setup_theme', 'blogway_theme_setup' ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function blogway_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Front-Page Left Sidebar Section', 'blogway'), 'id' => 'front-left-page-sidebar', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => esc_html__( 'Front-Page Right Sidebar Section', 'blogway'), 'id' => 'front-right-page-sidebar', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', ) ); } add_action( 'widgets_init', 'blogway_widgets_init' ); function blogway_remove_some_widgets(){ // Unregister Frontpage sidebar unregister_sidebar( 'front-page-sidebar' ); } add_action( 'widgets_init', 'blogway_remove_some_widgets', 11 ); add_action( 'customize_register', 'blogway_customizer_rid_values', 1000 ); function blogway_customizer_rid_values($wp_customize) { $wp_customize->remove_control('select_slider_3_post_category'); $wp_customize->remove_control('main_slider_below_3_title'); $wp_customize->remove_control('editorials_section_title'); $wp_customize->remove_control('select_editorials_category'); } /** * Outputs the tab posts * * @since 1.0.0 * * @param array $args Post Arguments. */ if (!function_exists('blogway_render_posts')): function blogway_render_posts( $type, $show_excerpt, $excerpt_length, $number_of_posts, $category = '0' ){ $args = array(); switch ($type) { case 'popular': $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => absint($number_of_posts), 'orderby' => 'comment_count', 'ignore_sticky_posts' => true ); break; case 'recent': $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => absint($number_of_posts), 'orderby' => 'date', 'ignore_sticky_posts' => true ); break; case 'categorised': $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => absint($number_of_posts), 'ignore_sticky_posts' => true ); $category = isset($category) ? $category : '0'; if (absint($category) > 0) { $args['cat'] = absint($category); } break; default: break; } if( !empty($args) && is_array($args) ){ $all_posts = new WP_Query($args); if($all_posts->have_posts()): echo '
'; while($all_posts->have_posts()): $all_posts->the_post(); ?>
'; endif; } } endif; /*--------------------------------------------------------------------*/ /* Register Google Fonts /*--------------------------------------------------------------------*/ function blogway_fonts_url() { $fonts_url = ''; $font_families = array(); $font_families = array('Zilla Slab:300,400,500,600,700,&display=swap'); $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); return $fonts_url; } function blogway_scripts_styles() { wp_enqueue_style( 'blogway-fonts', blogway_fonts_url(), array(), null ); } add_action( 'wp_enqueue_scripts', 'blogway_scripts_styles' ); function blogway_menu(){ ?>