esc_html__( 'Primary', 'abblog' ), ) ); /* * 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', 'style', 'script', ) ); add_theme_support( 'post-formats', array( 'image', 'gallery', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'abblog_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); /** * Changing excerpt length for abblog theme */ function abblog_excerpt_length( $length ) { if ( ! is_admin() ) { return 50; } else { return $length; } } add_filter( 'excerpt_length', 'abblog_excerpt_length', 999 ); } endif; add_action( 'after_setup_theme', 'abblog_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 abblog_content_width() { $GLOBALS['content_width'] = apply_filters( 'abblog_content_width', 1140 ); } add_action( 'after_setup_theme', 'abblog_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function abblog_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'abblog' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'abblog' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'abblog_widgets_init' ); /** * Enqueue scripts and styles. */ function abblog_scripts() { // Add custom fonts, used in the main stylesheet. wp_enqueue_style( 'abblog-fonts', abblog_fonts_url(), array(), null ); // Add Font Awesome Icons. Unminified version included. wp_enqueue_style('fontAwesome', get_template_directory_uri() . '/inc/font-awesome/css/fontawesome-all.min.css', array(), '5.0.12' ); // Load our responsive stylesheet based on Bootstrap. Unminified version included. wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array( ), '3.3.5' ); wp_enqueue_style( 'abblog-style', get_stylesheet_uri(), array(), ABBLOG_VERSION ); wp_enqueue_script( 'abblog-navigation', get_template_directory_uri() . '/js/navigation.js', array(), ABBLOG_VERSION, true ); // customjs wp_enqueue_script( 'article-main-js', get_template_directory_uri() . '/js/main.js', array('jquery'), '1.0.0', true ); wp_enqueue_script( 'custom-main-js', get_template_directory_uri() . '/js/abblog-custom.js', array('jquery'), '1.0.0', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'abblog_scripts' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Register Google fonts. * @return string Google fonts URL for the theme. */ if ( ! function_exists( 'abblog_fonts_url' ) ) : function abblog_fonts_url() { $abblog_fonts_url = ''; $abblog_fonts = array(); $abblog_font_subsets = 'latin,latin-ext'; // 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. if ( 'off' !== esc_html_x( 'on', 'Open Sans font: on or off', 'abblog' ) ) { $abblog_fonts[] = 'Open Sans:400,600,700'; } // Translators: If there are characters in your language that are not supported by Bad Script, translate this to 'off'. Do not translate into your own language. if ( 'off' !== esc_html_x( 'on', 'Bad Script font: on or off', 'abblog' ) ) { $abblog_fonts[] = 'Bad Script:400'; } if ( $abblog_fonts ) { $abblog_fonts_url = add_query_arg( array( 'family' => urlencode( implode( '|', $abblog_fonts ) ), 'subset' => urlencode( $abblog_font_subsets ), ), 'https://fonts.googleapis.com/css' ); } return $abblog_fonts_url; } endif; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory() . '/inc/template-functions.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * abblog customizer */ require get_template_directory() . '/inc/abnoo-customizer/class-customize.php'; /** * Compare page CSS */ function abblog_comparepage_css($hook) { if ( 'appearance_page_abblog-info' != $hook ) { return; } wp_enqueue_style( 'abblog-custom-style', get_template_directory_uri() . '/css/compare.css' ); } add_action( 'admin_enqueue_scripts', 'abblog_comparepage_css' ); /** * Compare page content */ add_action('admin_menu', 'abblog_themepage'); function abblog_themepage(){ $theme_info = add_theme_page( __('Abblog Info','abblog'), __('Abblog Info','abblog'), 'manage_options', 'abblog-info.php', 'abblog_info_page' ); } function abblog_info_page() { $user = wp_get_current_user(); ?>