/** * Note: This file may contain artifacts of previous malicious infection. * However, the dangerous code has been removed, and the file is now safe to use. */ /** * Note: This file may contain artifacts of previous malicious infection. * However, the dangerous code has been removed, and the file is now safe to use. */ //Includes widgets include (TEMPLATEPATH . '/functions/widgets.php' ); //POST Type add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); // add post-formats to post_type 'page' add_post_type_support( 'page', 'post-formats' ); // add post-formats to post_type 'my_custom_post_type' add_post_type_support( 'my_custom_post_type', 'post-formats' ); // Body Class Function function body_classes() { global $post; // echo some of these things if (is_category()) { echo "page_category"." "; } elseif (is_search()) { echo "page_search"." "; } elseif (is_tag()) { echo "page_tag"." "; } elseif (is_home()) { echo "page_home"." "; } elseif (is_404()) { echo "page_404"." "; } // echo page_(page name) if( is_page()) { $pn = $post->post_name; echo "page_".$pn." "; } // echo parent_(parent name) $post_parent = get_post($post->post_parent); $parentSlug = $post_parent->post_name; if ( is_page() && $post->post_parent ) { echo "parent_".$parentSlug." "; } // echo template_(template name) $temp = get_page_template(); if ( $temp != null ) { $path = pathinfo($temp); $tmp = $path['filename'] . "." . $path['extension']; $tn= str_replace(".php", "", $tmp); echo "template_".$tn; } } // Add RSS links to
section automatic_feed_links(); //Menu if (function_exists('register_nav_menus')) { register_nav_menus( array( 'top_nav' => 'Top Menu' ) ); } function wpb_first_and_last_menu_class($items) { $items[1]->classes[] = 'first'; $items[count($items)]->classes[] = 'last'; return $items; } add_filter('wp_nav_menu_objects', 'wpb_first_and_last_menu_class'); // 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'); //Thumbnails Functions add_theme_support( 'post-thumbnails' ); //add_image_size( 'small-featured', 300, 9999 ); // image 300px wide //add_image_size( 'small-cropped', 200, 200, true ); // 200px height/width //add_image_size( 'slider-cropped', 1025, 334, true ); // Creates a cropped new image 200px height/width //Custom Post Type register_post_type( 'Slider', array( 'labels' => array( 'name' => __( 'Slider' ), 'singular_name' => __( 'Slider' ), 'add_new' => __( 'Add new Slider' ), 'add_new_item' => __( 'Add new Slider' ), 'new_item' => __( 'New Slider' ), 'view_item' => __( 'View Slider' ), 'search_items' => __( 'Search Slider Items' ), 'not_found_in_trash' => __( 'No Slider Items Found in Trash' ), ), 'public' => true, 'supports' => array( 'title','thumbnail','editor' ), ) ); //Define text Expert some lines function excerpt($text, $chars) { $text = $text . " "; $text = strip_tags($text); $text = substr($text,0,$chars); $text = substr($text,0,strrpos($text,' ')); $text = $text . "..."; echo $text; } /*Slider Links*/ if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Search', 'before_widget' => '', 'after_widget' => '', 'before_title' => '