get( 'Name' )); } if (!defined('BROOKLYN_LITE_VER')) { define( 'BROOKLYN_LITE_VER', wp_get_theme()->get( 'Version' )); } if (!defined('BROOKLYN_LITE_CSS')) { define( 'BROOKLYN_LITE_CSS', get_template_directory_uri().'/assets/css/'); } if (!defined('BROOKLYN_LITE_JS')) { define( 'BROOKLYN_LITE_JS', get_template_directory_uri().'/assets/js/'); } if (!defined('BROOKLYN_LITE_PATH')) { define( 'BROOKLYN_LITE_PATH', get_template_directory()); } if (!defined('PROWPTHEME_PATH')) { define( 'PROWPTHEME_PATH', get_template_directory() . '/inc/prowptheme/'); } if (!defined('PROWPTHEME_THEME_URI')) { define( 'PROWPTHEME_THEME_URI', get_template_directory_uri() . '/inc/prowptheme/'); } if (!defined('BROOKLYN_LITE_THEME_URI')) { define( 'BROOKLYN_LITE_THEME_URI', get_template_directory_uri()); } if (!defined('AJAX_URL')) { define( 'AJAX_URL', esc_url_raw( admin_url('admin-ajax.php'))); } if ( ! function_exists( 'brooklyn_lite_setup' ) ) : /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function brooklyn_lite_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Brooklyn, use a find and replace * to change 'brooklyn-lite' to the name of your theme in all the template files. */ load_theme_textdomain( 'brooklyn-lite' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded 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' ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'main-menu' => esc_html__( 'Main Menu', 'brooklyn-lite' ), ) ); /* * 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', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'brooklyn_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, ) ); } endif; add_action( 'after_setup_theme', 'brooklyn_lite_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 brooklyn_lite_content_width() { $GLOBALS['content_width'] = apply_filters( 'brooklyn_lite_content_width', 640 ); } add_action( 'after_setup_theme', 'brooklyn_lite_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function brooklyn_lite_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'brooklyn-lite' ), 'id' => 'blog-sidebar', 'description' => esc_html__( 'Add widgets here.', 'brooklyn-lite' ), 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>', ) ); register_widget( 'ProWPTheme_Social' ); register_widget( 'ProWPTheme_Recent_Posts' ); } add_action( 'widgets_init', 'brooklyn_lite_widgets_init' ); // Google Fonts function brooklyn_lite_google_fonts_url() { $font_url = ''; if ( 'off' !== _x( 'on', 'Google font: on or off', 'brooklyn-lite' ) ) { $font_url = add_query_arg( 'family', urlencode( 'Montserrat: 300,400,500,600,700,800,900&display=swap|Muli:300,400,500,700,800,900' ), "//fonts.googleapis.com/css" ); } return $font_url; } /** * Enqueue scripts and styles. */ function brooklyn_lite_scripts() { //CSS wp_enqueue_style( 'brooklyn-lite-style', get_stylesheet_uri(), array(), BROOKLYN_LITE_VER ); wp_enqueue_style( 'bootstrap', BROOKLYN_LITE_CSS . 'bootstrap.min.css'); wp_enqueue_style( 'simple-line-icons', BROOKLYN_LITE_CSS . 'simple-line-icons.css'); wp_enqueue_style( 'fontawesome', BROOKLYN_LITE_CSS . 'font-awesome.min.css'); wp_enqueue_style( 'brooklyn-lite-themes', BROOKLYN_LITE_CSS . 'themes.css'); wp_enqueue_style( 'brooklyn-lite-google-fonts', brooklyn_lite_google_fonts_url() ); wp_style_add_data( 'brooklyn-lite-style', 'rtl', 'replace' ); //JS wp_enqueue_script( 'popper', BROOKLYN_LITE_JS . 'popper.min.js', array('jquery'), '', true ); wp_enqueue_script( 'bootstrap', BROOKLYN_LITE_JS . 'bootstrap.min.js', array('jquery'), '', true ); wp_enqueue_script( 'brooklyn-lite-scripts', BROOKLYN_LITE_JS . 'scripts.js', array('jquery'), '', true ); $brooklyn_lite_custom_css = ' .edit-post-visual-editor.editor-styles-wrapper{ font-family: Muli;} .editor-post-title__block .editor-post-title__input, .editor-styles-wrapper h1, .editor-styles-wrapper h2, .editor-styles-wrapper h3, .editor-styles-wrapper h4, .editor-styles-wrapper h5, .editor-styles-wrapper h6{font-family:Prata;} '; wp_add_inline_style( 'brooklyn_lite-editor-styles', $brooklyn_lite_custom_css ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'brooklyn_lite_scripts' ); /** * Load Theme Support on Init */ if(!( function_exists('brooklyn_lite_add_editor_styles') )){ function brooklyn_lite_add_editor_styles() { /** * Add WP Editor Styling */ add_editor_style( array('inc/editor-style.css'), brooklyn_lite_google_fonts_url() ); /** * 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 */ global $content_width; if ( ! isset( $content_width ) ) $content_width = 1170; } add_action( 'init', 'brooklyn_lite_add_editor_styles', 10 ); } // Includes Files require get_template_directory() . '/inc/custom-header.php'; require get_template_directory() . '/inc/template-tags.php'; require get_template_directory() . '/inc/template-functions.php'; require get_template_directory() . '/inc/customizer.php'; if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) { require_once get_template_directory().'/inc/class-wp-bootstrap-navwalker.php'; } require get_template_directory() . '/inc/breadcrumb-trail.php'; if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } if ( class_exists( 'WooCommerce' ) ) { require get_template_directory() . '/inc/woocommerce.php'; } if ( ! class_exists( 'TGM_Plugin_Activation' ) ) { require_once( get_template_directory() . '/inc/class-tgm-plugin-activation.php'); require_once( get_template_directory() . '/inc/required-plugins.php'); } /* ProWP Theme Core */ require PROWPTHEME_PATH . 'pwpt-core.php'; /** * Admin notice */ require PROWPTHEME_PATH . 'notices/persist-admin-notices-dismissal.php'; function brooklyn_lite_welcome_admin_notice() { if ( ! PAnD::is_admin_notice_active( 'brooklyn-lite-welcome-forever' ) ) { return; } ?> <div data-dismissible="brooklyn-lite-welcome-forever" class="brooklyn-lite-admin-notice updated notice notice-success is-dismissible"> <p> <?php echo sprintf( __( 'Welcome to Brooklyn Lite. To get started please make sure to visit our <a href="%s">welcome page</a>.', 'brooklyn-lite' ), admin_url( 'admin.php?page=brooklyn-lite-info.php' ) ); ?> </p> <a class="button" href="<?php echo admin_url( 'admin.php?page=brooklyn-lite-info.php' ); ?>"> <?php esc_html_e( 'Get started with Brooklyn Lite', 'brooklyn-lite' ); ?> </a> </div> <?php } add_action( 'admin_init', array( 'PAnD', 'init' ) ); add_action( 'admin_notices', 'brooklyn_lite_welcome_admin_notice' );