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( 'menu-1' => esc_html__( 'Primary', 'fire-blog' ), ) ); /* * 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', ) ); // 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, ) ); add_image_size( 'fire_blog_homepage_slider', 675, 450, true ); add_image_size( 'fire_blog_homepage_sticky_posts', 920, 414, true ); add_image_size( 'fire_blog_homepage_posts', 540, 243, true ); add_image_size( 'fire_blog_single_page', 760, 329, true ); add_image_size( 'fire_blog_archive_page', 160, 160, true ); add_image_size( 'fire_blog_portfolio_content', 378, 252, true ); add_image_size( 'fire_blog_our_team', 225, 225, true ); add_image_size( 'fire_blog_edu_popular_courses', 348, 232, true ); add_image_size( 'fire_blog_edu_team', 255, 343, true ); add_image_size( 'fire_blog_edu_latest_posts', 350, 158.5, true ); add_image_size( 'fire_blog_wedding_slider', 1349, 731, true ); add_image_size( 'fire_blog_wedding_stories', 350, 438, true ); add_image_size( 'fire_blog_wed_content', 370, 242, true ); add_image_size( 'fire_blog_mobile_content', 1000, 654, true ); add_image_size( 'fire_blog_construction_contact_section', 525, 350, true ); add_image_size( 'fire_blog_call_to_action', 540, 363, true ); add_image_size( 'fire_blog_construction_partner', 155, 141, true ); add_image_size( 'fire_blog_medical_department', 350, 255, true ); add_image_size( 'fire_blog_medical_blog', 350, 233, true ); add_image_size( 'fire_blog_medical_team', 248, 248, true ); } endif; add_action( 'after_setup_theme', 'fire_blog_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 fire_blog_content_width() { $GLOBALS['content_width'] = apply_filters( 'fire_blog_content_width', 640 ); } add_action( 'after_setup_theme', 'fire_blog_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function fire_blog_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'fire-blog' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Add widgets here.', 'fire-blog' ), 'before_widget' => '
', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 1', 'fire-blog' ), 'id' => 'footer_1', 'description' => esc_html__( 'Add widgets in the bottom area.', 'fire-blog' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 2', 'fire-blog' ), 'id' => 'footer_2', 'description' => esc_html__( 'Add widgets in the bottom area.', 'fire-blog' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => esc_html__( 'Footer 3', 'fire-blog' ), 'id' => 'footer_3', 'description' => esc_html__( 'Add widgets in the bottom area.', 'fire-blog' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => esc_html__( 'Single Page', 'fire-blog' ), 'id' => 'single_page', 'description' => esc_html__( 'Add widgets in single middle section', 'fire-blog' ), 'before_widget' => ' ', 'before_title' => ' ', ) ); } add_action( 'widgets_init', 'fire_blog_widgets_init' ); /** * Enqueue scripts and styles. */ function fire_blog_scripts() { /** * CSS */ wp_enqueue_style( 'fire-blog-style', get_stylesheet_uri() ); wp_enqueue_style( 'bootstrap', get_template_directory_uri(). '/css/bootstrap.min.css' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri(). '/css/font-awesome.min.css' ); wp_enqueue_style( 'animate', get_template_directory_uri(). '/css/animate.min.css' ); wp_enqueue_style( 'fire-blog-plugin.css', get_template_directory_uri(). '/css/plugin.css' ); wp_enqueue_style( 'fire-blog-worksans_font','https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700' ); wp_enqueue_style( 'fire-blog-josefin_sans', 'https://fonts.googleapis.com/css?family=Josefin+Sans:300,400,400i,600,700' ); wp_enqueue_style( 'fire-blog-style1', get_template_directory_uri(). '/css/style.css' ); /** * JS */ wp_enqueue_script( 'slick-lightbox', get_template_directory_uri() . '/js/slick-lightbox.min.js', array('jquery'),array(), true ); wp_enqueue_script( 'fire-blog_tether', get_template_directory_uri() . '/js/tether.min.js', array('jquery'), true ); wp_enqueue_script( 'waypoint', get_template_directory_uri() . '/js/waypoint.min.js',array('jquery'), true ); wp_enqueue_script( 'smoothscroll', get_template_directory_uri() . '/js/smoothscroll.js',array('jquery'), true ); wp_enqueue_script( 'isotope', get_template_directory_uri() . '/js/isotope.min.js',array('jquery'), true ); wp_enqueue_script( 'slick', get_template_directory_uri() . '/js/slick.min.js',array('jquery'), true ); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js',array('jquery'), true ); wp_enqueue_script( 'slicknav', get_template_directory_uri() . '/js/slicknav.js',array('jquery'), true ); wp_enqueue_script( 'easing', get_template_directory_uri() . '/js/easing.js',array('jquery'), true ); wp_register_script( 'fire-blog_custom', get_template_directory_uri() . '/js/custom.js', array('jquery'),array(), true ); $map_info = array(); $map_var = apply_filters( 'fire_blog_localize_script', $map_info ); wp_localize_script( 'fire-blog_custom', 'fire_blog_object', $map_var ); wp_enqueue_script( 'fire-blog_custom' ); wp_enqueue_script( 'jquery_parallex', get_template_directory_uri() . '/js/jquery_parallax.js', array('jquery'),array(), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'fire_blog_scripts' ); /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; require get_template_directory() . '/inc/class-tgm-plugin-activation.php'; /** * Load Jetpack compatibility file. */ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } /** * Widgets */ require get_template_directory() . '/inc/widgets/about-me.php'; // Class for li add_filter('nav_menu_css_class','fire_blog_menu_li_class',1,3); function fire_blog_menu_li_class($classes, $item, $args) { if($args->theme_location == 'menu-1') { $classes[] = 'nav-item dropdown has-submenu'; } return $classes; } // Class for anchor add_filter( 'nav_menu_link_attributes', 'fire_blog_menu_anchor_class', 10, 3 ); function fire_blog_menu_anchor_class( $atts, $item, $args ) { $class = 'nav-link ' . ( empty( $item->menu_item_parent ) ? 'dropdown-toggle' : '' ) ; // or something based on $item $atts['class'] = $class; return $atts; } function fire_blog_get_logo(){ $custom_logo_id = get_theme_mod( 'custom_logo' ); $logo = wp_get_attachment_image_src( $custom_logo_id, 'full' ); if( has_custom_logo() ){ ?> '; echo ''. esc_html( get_bloginfo( 'description' ) ) . '
'; echo ''; } } /** * Breadcrumbs */ function fire_blog_custom_breadcrumbs() { // Settings $separator = '/'; $breadcrums_id = 'breadcrumbs'; $breadcrums_class = 'breadcrumbs'; $home_title = esc_html__( 'Home' , 'fire-blog' );; // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat) $custom_taxonomy = 'category'; // Get the query & post information global $post,$wp_query; // Do not display on the homepage if ( !is_front_page() ) { // Home page echo ''; esc_html_e( 'Copyright ©', 'fire-blog' ); echo date_i18n( __( 'Y' , 'fire-blog' ) ); ?> WordPress' ); ?> & '; } } add_filter('nav_menu_css_class' , 'fire_blog_special_nav_class' , 10 , 2); function fire_blog_special_nav_class($classes, $item) { if (in_array('current-menu-item', $classes) ){ $classes[] = 'active '; } return $classes; } function fire_blog_all_pages(){ $data = array(); $pages = get_pages(); foreach ($pages as $page ) { $id = $page->ID; $data[$id] = $page->post_title; } return $data; } /** * Recommended plugins */ add_action( 'tgmpa_register', 'fire_blog_register_required_plugins' ); function fire_blog_register_required_plugins() { $plugins = array( array( 'name' => esc_html__( 'Kirki', 'fire-blog' ), 'slug' => 'kirki' ), array( 'name' => esc_html__( 'Cyclone Widgets', 'fire-blog' ), 'slug' => 'cyclone-widget' ) ); $config = array( 'id' => 'fire_blog_tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => '', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'parent_slug' => 'themes.php', // Parent menu slug. 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); } add_filter( 'excerpt_length', 'fire_blog_custom_excerpt_length', 999 ); function fire_blog_custom_excerpt_length( $length ) { return 15; }