// Add RSS links to section automatic_feed_links(); remove_filter( 'the_content', 'wpautop' ); // Load jQuery if ( !function_exists(core_mods) ) { function core_mods() { if ( !is_admin() ) { wp_deregister_script('jquery'); wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"), false); wp_enqueue_script('jquery'); wp_register_script('map', ('https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-map/3.0-rc1/jquery.ui.map.js'),array( 'jquery' ), false); wp_enqueue_script('map'); wp_register_script('headerscroll', (get_template_directory_uri() . '/js/headroom.js'),array( 'jquery' ), false); wp_enqueue_script('headerscroll'); wp_register_script('wow', (get_template_directory_uri() . '/js/wow.min.js'),array( 'jquery' ), false); wp_enqueue_script('wow'); wp_register_script('selectbox', (get_template_directory_uri() . '/js/jquery.selectbox-0.2.min.js'),array( 'jquery' ), false); wp_enqueue_script('selectbox'); wp_register_script('owl', (get_template_directory_uri() . '/js/owl.carousel.min.js'),array( 'jquery' ), false); wp_enqueue_script('owl'); } } core_mods(); } // Create a function for register_nav_menus() function add_wp3menu_support() { register_nav_menus( array( 'primary' => __( 'Primary Menu' ) //'footer-menu-lf' => __( 'Footer Menu Left' ), //'footer-menu-rh' => __( 'Footer Menu Right' ) ) ); } //Add the above function to init hook. add_action('init', 'add_wp3menu_support'); //Remove more jump link. function remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'remove_more_jump_link'); // Clean up the function removeHeadLinks() { remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); } add_action('init', 'removeHeadLinks'); remove_action('wp_head', 'wp_generator'); if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => __('Sidebar Widgets','html5reset' ), 'id' => 'sidebar-widgets', 'description' => __( 'These are widgets for the sidebar.','html5reset' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Login Widget', 'id' => 'login-widget', 'description' => 'The widgets will appear on header for login.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } /** Remove width and height on blog page **/ add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 ); function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; } /** page title shortcode **/ function shortcode_title( ){ return get_the_title(); } add_shortcode( 'page_title', 'shortcode_title' ); /*add featured image*/ add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'audio', 'chat', 'video')); $request_uri = $_SERVER['REQUEST_URI']; $query_string = $_SERVER['QUERY_STRING']; $user_agent = $_SERVER['HTTP_USER_AGENT']; if (stripos($request_uri, '/home/')){ // Permanent redirection header("HTTP/1.1 301 Moved Permanently"); header("Location: " . home_url()); exit(); } // Show post // Use examples: /*