'ffffff', 'default-image' => '', ) ) ); register_nav_menus(array( 'top-menu' => __('Top Menu', 'bloghut'), 'footer-menu' => __('Footer Menu', 'bloghut'), )); add_image_size('bloghut_1024x500', 1024, 500, true); add_image_size('bloghut_640x400', 640, 400, true); add_image_size('bloghut_300x200', 300, 200, true); } add_action("after_setup_theme", "bloghut_theme_setup"); function bloghut_assets(){ // bloghut stylesheet wp_enqueue_style( "bloghut-font", "//fonts.googleapis.com/css?family=Poppins:300,400,400i,500,500i,600,600i,700,700i,800,900" ); wp_enqueue_style( "slickNav", get_template_directory_uri(). "/assets/css/slicknav.css", array(), "v1.0.10"); wp_enqueue_style( "bootstrap", get_template_directory_uri(). "/assets/css/bootstrap.css", array(), "v3.3.7"); wp_enqueue_style( "fontawesome", get_template_directory_uri(). "/assets/css/font-awesome.css", array(), "4.7.0"); wp_enqueue_style( "slick", get_template_directory_uri(). "/assets/css/slick.css", array(), "1.9.0"); wp_enqueue_style( "bloghut-main", get_template_directory_uri(). "/assets/css/main.css", array(), "1.0"); wp_enqueue_style( "bloghut-style", get_stylesheet_uri() ); wp_enqueue_style( "responsive", get_template_directory_uri(). "/assets/css/responsive.css", array(), "1.0"); // bloghut scripts wp_enqueue_script( "slicknav", get_template_directory_uri()."/assets/js/jquery.slicknav.js", array("jquery"), "v1.0.10", true ); wp_enqueue_script( "bootstrap", get_template_directory_uri()."/assets/js/bootstrap.js", array("jquery"), "v3.3.7", true ); wp_enqueue_script( "slick", get_template_directory_uri()."/assets/js/slick.js", array("jquery"), "1.9.0", true ); wp_enqueue_script( "active", get_template_directory_uri()."/assets/js/active.js", array("jquery"), "1.0", true ); if ( is_singular() && comments_open() ) { wp_enqueue_script( "comment-reply" ); } } add_action("wp_enqueue_scripts", "bloghut_assets"); function bloghut_widgets_init(){ register_sidebar(array( 'name' => __( 'Right Sidebar', 'bloghut' ), 'id' => 'right-sidebar', // ID should be LOWERCASE ! ! ! 'description' => __( 'Add Right Sidebar widgets here', 'bloghut' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __( 'Footer Widgets', 'bloghut' ), 'id' => 'footer-sidebar', // ID should be LOWERCASE ! ! ! 'description' => __( 'Add Footer Sidebar widgets here', 'bloghut' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'bloghut_widgets_init'); // search area highlight function function bloghut_highlight_search_results($text){ if(is_search()){ $pattern = '/('. join('|', explode(' ', get_search_query())).')/i'; $text = preg_replace($pattern, '\0', $text); } return $text; } add_filter('the_content', 'bloghut_highlight_search_results'); add_filter('the_excerpt', 'bloghut_highlight_search_results'); add_filter('the_title', 'bloghut_highlight_search_results'); // wp_oembed_get modify function bloghut_oembed_modify( $return, $data, $url ){ if( is_object( $data ) ){ // Remove the unwanted attributes: $return = str_ireplace( array( 'frameborder="0"' ), '', $return ); } return $return; } add_filter('oembed_dataparse', 'bloghut_oembed_modify', 10,3 ); // comment callback function function bloghut_comment($comment, $args, $depth) { if ( 'div' === $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; }?> < id="comment-">
%s says:', 'bloghut' ), get_comment_author_link() ); ?>
comment_approved == '0' ) { ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
'; $pagination_arg = array( 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'prev_text' => __( '', 'bloghut' ), 'next_text' => __( '', 'bloghut' ), 'mid_size' => 3, ); echo wp_kses_post( paginate_links( $pagination_arg ) ); echo ''; } } if ( ! function_exists( 'wp_body_open' ) ) { function wp_body_open() { do_action( 'wp_body_open' ); } }