'
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); function body_classes( $classes ) { if ( function_exists( 'is_multi_author' ) && ! is_multi_author() ) $classes[] = 'single-author'; if ( is_singular() && ! is_home() && ! is_page_template( 'index.php' ) && ! is_page_template( 'page.php' ) ) $classes[] = 'singular'; return $classes; } function mdv_recent_posts($no_posts = 5, $before = '
  • ', $after = '
  • ', $hide_pass_post = true, $skip_posts = 0, $show_excerpts = false, $include_pages = false) { global $wpdb; $time_difference = get_option('gmt_offset'); $now = gmdate("Y-m-d H:i:s",time()); $request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' "; if($hide_pass_post) $request .= "AND post_password ='' "; if($include_pages) $request .= "AND (post_type='post' OR post_type='page') "; else $request .= "AND post_type='post' "; $request .= "AND post_date_gmt < '$now' ORDER BY post_date DESC LIMIT $skip_posts, $no_posts"; $posts = $wpdb->get_results($request); $output = ''; if ( ! isset( $content_width ) ) $content_width = 465; if($posts) { foreach ($posts as $post) { $post_title = stripslashes($post->post_title); $permalink = get_permalink($post->ID); add_theme_support( 'automatic-feed-links' ); $output .= $before . '' . $post_title . ''; if($show_excerpts) { $post_excerpt = stripslashes($post->post_excerpt); $output.= '
    ' . $post_excerpt; } $output .= $after; } } else { $output .= $before . "None found" . $after; } echo $output; } function twentyeleven_setup() { /* Make Twenty Eleven available for translation. * Translations can be added to the /languages/ directory. * If you're building a theme based on Twenty Eleven, use a find and replace * to change 'twentyeleven' to the name of your theme in all the template files. */ load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // Load up our theme options page and related code. require( get_template_directory() . '/inc/theme-options.php' ); // Grab Twenty Eleven's Ephemera widget. require( get_template_directory() . '/inc/widgets.php' ); // Add support for custom backgrounds add_custom_background(); the_post_thumbnail(); // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images add_theme_support( 'post-thumbnails' ); // The next four constants set how Twenty Eleven supports custom headers. // The default header text color define( 'HEADER_TEXTCOLOR', '000' ); // By leaving empty, we allow for random image rotation. define( 'HEADER_IMAGE', '' ); // The height and width of your custom header. // Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 288 ) ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be the size of the header image that we just defined // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Add Twenty Eleven's custom image sizes add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature (header) images add_image_size( 'small-feature', 500, 300 ); // Used for featured posts if a large-feature doesn't exist // Turn on random header image rotation by default. add_theme_support( 'custom-header', array( 'random-default' => true ) ); // Add a way for the custom header to be styled in the admin panel that controls // custom headers. See twentyeleven_admin_header_style(), below. add_custom_image_header( 'twentyeleven_header_style', 'twentyeleven_admin_header_style', 'twentyeleven_admin_header_image' ); // ... and thus ends the changeable header business. } //GsL98DGtpo0W