get_template_directory_uri() .'/scripts/images/header.jpg', 'width' => 1920, 'height' => 600, 'uploads' => true, ); add_theme_support( 'custom-header', $defaults ); // Menus register_nav_menus(array( 'primary' => esc_html__('Primary Menu', 'bodyfit'), )); // add excerpt support for pages add_post_type_support( 'page', 'excerpt' ); if ( is_singular() && comments_open() ) { wp_enqueue_script( 'comment-reply' ); } // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // Custom Backgrounds add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', ) ); // To use additional css add_editor_style( 'scripts/css/editor-style.css' ); } add_action( 'after_setup_theme', 'bodyfit_theme_setup' ); } // Register Nav Walker class_alias require get_template_directory(). '/class-wp-bootstrap-navwalker.php'; require get_template_directory(). '/insert/extras.php'; /** * Enqueue CSS stylesheets */ if( ! function_exists( 'bodyfit_enqueue_styles' ) ) { function bodyfit_enqueue_styles() { wp_enqueue_style('bodyfit-font', 'https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700,800|Open+Sans:300,400',''); wp_enqueue_style('font-awesome', get_template_directory_uri() .'/scripts/css/font-awesome.css',''); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/scripts/css/bootstrap.css',''); wp_enqueue_style('fancybox', get_template_directory_uri() . '/scripts/css/jquery.fancybox.css',''); // main style wp_enqueue_style( 'bodyfit-style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'bodyfit_enqueue_styles' ); } /** * Enqueue JS scripts */ if( ! function_exists( 'bodyfit_enqueue_scripts' ) ) { function bodyfit_enqueue_scripts() { wp_enqueue_script('jquery'); wp_enqueue_script('idangerous.swiper', get_template_directory_uri() . '/scripts/js/idangerous.swiper.js',array(),'', true); wp_enqueue_script('fancybox', get_template_directory_uri() . '/scripts/js/jquery.fancybox.js',array(),'', true); wp_enqueue_script('main-js', get_template_directory_uri() . '/scripts/js/main.js',array(),'', true); } add_action( 'wp_enqueue_scripts', 'bodyfit_enqueue_scripts' ); } function bodyfit_cat_count_span($links) { $links = str_replace(' (', ' ', $links); $links = str_replace(')', '', $links); return $links; } add_filter('wp_list_categories', 'bodyfit_cat_count_span'); function bodyfit_style_the_archive_count($links) { $links = str_replace(' (', ' ', $links); $links = str_replace(')', '', $links); return $links; } add_filter('get_archives_link', 'bodyfit_style_the_archive_count'); //post excerpt function bodyfit_theme_excerpt_global_length( $length ) { return 30; } function bodyfit_theme_excerpt(){ add_filter( 'excerpt_length', 'bodyfit_theme_excerpt_global_length', 999 ); echo get_the_excerpt(); } function new_excerpt_more( $more ) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); /** * Register sidebars for bodyfit */ function bodyfit_sidebars() { // Blog Sidebar register_sidebar(array( 'name' => esc_html__( 'Blog Sidebar', "bodyfit"), 'id' => 'blog-sidebar', 'description' => esc_html__( 'Sidebar on the blog layout.', "bodyfit"), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); // Footer Sidebar register_sidebar(array( 'name' => esc_html__( 'Footer Widget Area 1', "bodyfit"), 'id' => 'bodyfit-footer-widget-area-1', 'description' => esc_html__( 'The footer widget area 1', "bodyfit"), 'before_widget' => ' ', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__( 'Footer Widget Area 2', "bodyfit"), 'id' => 'bodyfit-footer-widget-area-2', 'description' => esc_html__( 'The footer widget area 2', "bodyfit"), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__( 'Footer Widget Area 3', "bodyfit"), 'id' => 'bodyfit-footer-widget-area-3', 'description' => esc_html__( 'The footer widget area 3', "bodyfit"), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__( 'Footer Widget Area 4', "bodyfit"), 'id' => 'bodyfit-footer-widget-area-4', 'description' => esc_html__( 'The footer widget area 4', "bodyfit"), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'bodyfit_sidebars' ); /** * Comment layout */ function bodyfit_comments( $comment, $args, $depth ) { ?>
id=""> comment_approved == '0') : ?>

array( 'media-object','' ) )); ?>

$depth, 'max_depth' => $args['max_depth']))) ?>