1000, 'height' => 250, 'flex-height' => true, 'flex-width' => true, 'uploads' => true, ); add_theme_support( 'custom-header' , $custom_header_defaults ); } add_action( 'after_setup_theme', 'awp_editor_styles' ); function awp_editor_styles() { $style_path = apply_filters( 'awp_editor_style_path' , '' ); if ( $style_path ) { add_editor_style( esc_url( $style_path ) ); } } add_action( 'wp_enqueue_scripts', 'awp_enqueue_styles' ); function awp_enqueue_styles() { $primary_bootstrap_css_path = apply_filters( 'awp_primary_bootstrap_css_path' , get_template_directory_uri() . '/bootstrap/css/bootstrap-basic.min.css' ); $second_bootstrap_css_path = apply_filters( 'awp_second_bootstrap_css_path' , '' ); // MIT License : https://github.com/twbs/bootstrap/blob/master/LICENSE wp_enqueue_style( AWP_THEME_SLUG . '-primary-bootstrap-css' , $primary_bootstrap_css_path , '' , AWP_THEME_VERSION ); if ( $second_bootstrap_css_path ) { awp_enqueue_file_followed_by_style_css( $second_bootstrap_css_path ); } else { awp_only_enqueue_style_css(); } wp_enqueue_style( AWP_THEME_SLUG . '-print-css' , get_template_directory_uri() . '/print.css' , '' , AWP_THEME_VERSION , 'print' ); } function awp_enqueue_file_followed_by_style_css( $second_bootstrap_css_path ) { wp_enqueue_style( AWP_THEME_SLUG . '-second-bootstrap-css' , $second_bootstrap_css_path , array( AWP_THEME_SLUG . '-primary-bootstrap-css' ) , AWP_THEME_VERSION ); wp_enqueue_style( AWP_THEME_SLUG . '-main-css' , get_stylesheet_uri() , array( AWP_THEME_SLUG . '-second-bootstrap-css' ) , AWP_THEME_VERSION ); } function awp_only_enqueue_style_css() { wp_enqueue_style( AWP_THEME_SLUG . '-main-css' , get_stylesheet_uri() , array( AWP_THEME_SLUG . '-primary-bootstrap-css' ) , AWP_THEME_VERSION ); } add_action( 'wp_enqueue_scripts', 'awp_enqueue_js' ); function awp_enqueue_js() { global $wp_scripts; wp_register_script( AWP_THEME_VERSION . '-html5-shiv' , get_template_directory() . '/js/html5shiv.js' , array() , AWP_THEME_VERSION , false ); $wp_scripts->add_data( AWP_THEME_VERSION . '-html5-shiv' , 'conditional' , 'lt IE 9' ); wp_register_script( AWP_THEME_VERSION . '-respond-js' , get_template_directory() . '/js/respond.min.js' , array() , AWP_THEME_VERSION , false ); $wp_scripts->add_data( AWP_THEME_VERSION . '-respond-js' , 'conditional' , 'lt IE 9' ); wp_enqueue_script( 'jquery' ); // MIT License : https://github.com/twbs/bootstrap/blob/master/LICENSE $main_bootstrap_js_path = apply_filters( 'awp_js_for_bootstrap' , get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js' ); wp_enqueue_script( 'bootstrap_js' , $main_bootstrap_js_path , array( 'jquery' ) , AWP_THEME_VERSION , true ); } function awp_the_classes_of_first_top_navbar() { // 'navbar-fixed-top' fixes navbar $type = apply_filters( 'awp_classes_of_first_top_navbar' , 'navbar-default top-navbar navbar-static-top' ); echo 'navbar ' . esc_attr( $type ); } function awp_the_classes_of_second_top_navbar() { $type = apply_filters( 'awp_classes_of_second_top_navbar' , 'navbar-default navbar-static-top' ); echo 'navbar ' . esc_attr( $type ); } function awp_the_classes_of_bottom_navbar() { $classes = apply_filters( 'awp_classes_of_bottom_navbar' , 'navbar-default navbar-static-bottom' ); echo 'navbar ' . esc_attr( $classes ); } add_action( 'after_setup_theme', 'awp_menu_setup' ); function awp_menu_setup() { register_nav_menu( 'awp_main_menu' , __( 'Main Menu', 'adapter-wp' ) ); } add_action( 'after_setup_theme' , 'awp_set_content_width' ); function awp_set_content_width() { if ( ! isset( $content_width ) ) { $content_width = 600; } } if ( ! function_exists( 'awp_maybe_get_top_nav' ) ) { function awp_maybe_get_top_nav() { if ( should_page_have_top_and_bottom_navs() ) { get_template_part( 'navbar-top' ); awp_maybe_get_top_banner_parts(); } } } if ( ! function_exists( 'should_page_have_top_and_bottom_navs' ) ) { function should_page_have_top_and_bottom_navs() { if ( is_page() && ( false != strpos( get_page_template() , 'no-nav' ) ) ) { return false; } return true; } } if ( ! function_exists( 'awp_maybe_get_top_banner_parts' ) ) { function awp_maybe_get_top_banner_parts() { $do_get_top_banner = apply_filters( 'awp_do_get_top_banner' , true ); if ( $do_get_top_banner ) { get_template_part( 'top-banner' ); } } } if ( ! function_exists( 'awp_the_top_banner_backround_alignment' ) ) { function awp_the_top_banner_backround_alignment() { $alignment = apply_filters( 'awp_top_banner_backround_alignment' , 'center' ); echo esc_attr( $alignment ); } } if( ! function_exists( 'awp_maybe_get_bottom_nav' ) ) { function awp_maybe_get_bottom_nav() { $top_and_bottom_navs_allowed = should_page_have_top_and_bottom_navs(); $do_get_bottom_nav = apply_filters( 'awp_do_get_bottom_nav' , $top_and_bottom_navs_allowed ); if ( $do_get_bottom_nav ) { get_template_part( 'navbar-bottom' ); } } } if ( ! function_exists( 'awp_the_top_nav_menu' ) ) { function awp_the_top_nav_menu() { $menu_name = 'awp_main_menu'; wp_nav_menu( array( 'menu' => $menu_name , 'theme_location' => $menu_name , 'depth' => 3 , 'container' => false , 'menu_class' => 'nav navbar-nav' , 'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback', 'walker' => new WP_Bootstrap_Navwalker() , ) ); } } add_action( 'comment_form' , 'awp_maybe_enqueue_comment_reply' ); function awp_maybe_enqueue_comment_reply() { if ( comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } remove_action( 'wp_head', 'rsd_link' ); remove_action( 'wp_head', 'wp_generator' ); remove_action( 'wp_head', 'wlwmanifest_link' ); if ( ! function_exists( 'awp_simple_copyright' ) ) { function awp_simple_copyright() { $name = apply_filters( 'awp_name_next_to_copyright_in_footer' , sprintf( __( '%s' , 'adapter-wp' ) , get_bloginfo( 'admin' ) ) ); echo "©" . " " . $name . " " . date( 'Y' ); } } function awp_the_bottom_copyright_classes() { echo apply_filters( 'awp_bottom_copyright_classes' , '' ); } if ( ! function_exists( 'awp_paginate_links' ) ) { function awp_paginate_links() { global $wp_query; $awp_big = 999999999; $pagination_args = array( 'base' => str_replace( $awp_big, '%#%', esc_url( get_pagenum_link( $awp_big ) ) ), 'format' => '/page/%#%', 'type' => 'array' , 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'prev_next' => True, 'prev_text' => sprintf( __( '%sNewer' , 'adapter-wp' ) , ' ' ) , 'next_text' => sprintf( __( 'Older%s' , 'adapter-wp' ) , ' ' ) , ); $pagination = paginate_links( $pagination_args ); $pagination_size = apply_filters( 'awp_pagination_size' , '' ); ?>