'/style.css', 'blogtube-fontawesome' => '/fonts/fontawesome/css/all.min.css', ); foreach ($styles as $handle => $file) { wp_enqueue_style($handle, $theme_directory . $file, array(), '1', 'all'); } } add_action('wp_enqueue_scripts', 'blogtube_styles'); // Theme Support add_theme_support('post-thumbnails'); add_theme_support("title-tag"); add_theme_support('automatic-feed-links'); add_theme_support('html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption', )); add_theme_support('align-wide'); add_theme_support('responsive-embeds'); function blogtube_enqueue_scripts() { // Load the wordpress comment script from the “\wordpress\wp-includes\js” directory. // This allows the comment response form to be located below the corresponding comment // and not at the very bottom of the page. if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_enqueue_script('blogtube_sidemenu_script', get_template_directory_uri() . '/js/blogtube_sidemenu.js', null, '1.0', true); // Infinitiyscroll Script if(is_home() & have_posts()|| is_search() & have_posts() || is_archive() & have_posts() ){ wp_enqueue_script('blogtube_infinityscroll_script', get_template_directory_uri() . '/js/blogtube_infinityscroll.js', null, '1.0', true); // Pass the Ajax URL to script.js wp_localize_script('blogtube_infinityscroll_script', 'my_scripts_vars', array( 'ajaxurl' => admin_url('admin-ajax.php') )); } } add_action('wp_enqueue_scripts', 'blogtube_enqueue_scripts'); // Number of words previewed in the feed function blogtube_custom_excerpt_length($length) { return get_theme_mod('words_in_snippet', 30); } add_filter('excerpt_length', 'blogtube_custom_excerpt_length', 999); // Characters after snippet function blogtube_custom_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'blogtube_custom_excerpt_more'); function blogtube_register_menus() { register_nav_menus( array( 'sidemenu' => __('Sidemenu', 'blogtube'), 'legal links' => __('legal links', 'blogtube'), ) ); } add_action('init', 'blogtube_register_menus'); function blogtube_register_sidebar() { register_sidebar(array( 'name' => __('Sidebar', 'blogtube'), 'id' => 'my-sidebar', 'before_widget' => '
', 'before_title' => '