PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/functions.php

https://github.com/blackandblack/bb_boilerplate
PHP | 546 lines | 256 code | 46 blank | 244 comment | 23 complexity | 422a02952e1c21d99c042dc9a8414633 MD5 | raw file
Possible License(s): MIT
  1. <?php
  2. /**
  3. * Boilerplate functions and definitions
  4. *
  5. * Sets up the theme and provides some helper functions. Some helper functions
  6. * are used in the theme as custom template tags. Others are attached to action and
  7. * filter hooks in WordPress to change core functionality.
  8. *
  9. * The first function, boilerplate_setup(), sets up the theme by registering support
  10. * for various features in WordPress, such as post thumbnails, navigation menus, and the like.
  11. *
  12. * When using a child theme (see http://codex.wordpress.org/Theme_Development and
  13. * http://codex.wordpress.org/Child_Themes), you can override certain functions
  14. * (those wrapped in a function_exists() call) by defining them first in your child theme's
  15. * functions.php file. The child theme's functions.php file is included before the parent
  16. * theme's file, so the child theme functions would be used.
  17. *
  18. * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
  19. * to a filter or action hook. The hook can be removed by using remove_action() or
  20. * remove_filter() and you can attach your own function to the hook.
  21. *
  22. * We can remove the parent theme's hook only after it is attached, which means we need to
  23. * wait until setting up the child theme:
  24. *
  25. * <code>
  26. * add_action( 'after_setup_theme', 'my_child_theme_setup' );
  27. * function my_child_theme_setup() {
  28. * // We are providing our own filter for excerpt_length (or using the unfiltered value)
  29. * remove_filter( 'excerpt_length', 'boilerplate_excerpt_length' );
  30. * ...
  31. * }
  32. * </code>
  33. *
  34. * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
  35. *
  36. * @package WordPress
  37. * @subpackage Boilerplate
  38. * @since Boilerplate 1.0
  39. */
  40. /**
  41. * Set the content width based on the theme's design and stylesheet.
  42. *
  43. * Used to set the width of images and content. Should be equal to the width the theme
  44. * is designed for, generally via the style.css stylesheet.
  45. */
  46. if ( ! isset( $content_width ) )
  47. $content_width = 640;
  48. /** Tell WordPress to run boilerplate_setup() when the 'after_setup_theme' hook is run. */
  49. add_action( 'after_setup_theme', 'boilerplate_setup' );
  50. if ( ! function_exists( 'boilerplate_setup' ) ):
  51. /**
  52. * Sets up theme defaults and registers support for various WordPress features.
  53. *
  54. * Note that this function is hooked into the after_setup_theme hook, which runs
  55. * before the init hook. The init hook is too late for some features, such as indicating
  56. * support post thumbnails.
  57. *
  58. * To override boilerplate_setup() in a child theme, add your own boilerplate_setup to your child theme's
  59. * functions.php file.
  60. *
  61. * @uses add_theme_support() To add support for post thumbnails and automatic feed links.
  62. * @uses register_nav_menus() To add support for navigation menus.
  63. * @uses add_custom_background() To add support for a custom background.
  64. * @uses add_editor_style() To style the visual editor.
  65. * @uses load_theme_textdomain() For translation/localization support.
  66. * @uses add_custom_image_header() To add support for a custom header.
  67. * @uses register_default_headers() To register the default custom header images provided with the theme.
  68. * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
  69. *
  70. * @since Twenty Ten 1.0
  71. */
  72. function boilerplate_setup() {
  73. // This theme styles the visual editor with editor-style.css to match the theme style.
  74. add_editor_style();
  75. // Uncomment if you choose to use post thumbnails; add the_post_thumbnail() wherever thumbnail should appear
  76. //add_theme_support( 'post-thumbnails' );
  77. // Add default posts and comments RSS feed links to head
  78. add_theme_support( 'automatic-feed-links' );
  79. // Make theme available for translation
  80. // Translations can be filed in the /languages/ directory
  81. load_theme_textdomain( 'boilerplate', TEMPLATEPATH . '/languages' );
  82. $locale = get_locale();
  83. $locale_file = TEMPLATEPATH . "/languages/$locale.php";
  84. if ( is_readable( $locale_file ) )
  85. require_once( $locale_file );
  86. // This theme uses wp_nav_menu() in one location.
  87. register_nav_menus( array(
  88. 'primary' => __( 'Primary Navigation', 'boilerplate' ),
  89. ) );
  90. // This theme allows users to set a custom background
  91. add_custom_background();
  92. // Your changeable header business starts here
  93. define( 'HEADER_TEXTCOLOR', '' );
  94. // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
  95. define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );
  96. // The height and width of your custom header. You can hook into the theme's own filters to change these values.
  97. // Add a filter to boilerplate_header_image_width and boilerplate_header_image_height to change these values.
  98. define( 'HEADER_IMAGE_WIDTH', apply_filters( 'boilerplate_header_image_width', 940 ) );
  99. define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'boilerplate_header_image_height', 198 ) );
  100. // We'll be using post thumbnails for custom header images on posts and pages.
  101. // We want them to be 940 pixels wide by 198 pixels tall.
  102. // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
  103. set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
  104. // Don't support text inside the header image.
  105. define( 'NO_HEADER_TEXT', true );
  106. // Add a way for the custom header to be styled in the admin panel that controls
  107. // custom headers. See boilerplate_admin_header_style(), below.
  108. add_custom_image_header( '', 'boilerplate_admin_header_style' );
  109. // ... and thus ends the changeable header business.
  110. // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
  111. register_default_headers( array(
  112. 'berries' => array(
  113. 'url' => '%s/images/headers/starkers.png',
  114. 'thumbnail_url' => '%s/images/headers/starkers-thumbnail.png',
  115. /* translators: header image description */
  116. 'description' => __( 'Boilerplate', 'boilerplate' )
  117. )
  118. ) );
  119. }
  120. endif;
  121. if ( ! function_exists( 'boilerplate_admin_header_style' ) ) :
  122. /**
  123. * Styles the header image displayed on the Appearance > Header admin panel.
  124. *
  125. * Referenced via add_custom_image_header() in boilerplate_setup().
  126. *
  127. * @since Twenty Ten 1.0
  128. */
  129. function boilerplate_admin_header_style() {
  130. ?>
  131. <style type="text/css">
  132. /* Shows the same border as on front end */
  133. #headimg {
  134. border-bottom: 1px solid #000;
  135. border-top: 4px solid #000;
  136. }
  137. /* If NO_HEADER_TEXT is false, you would style the text with these selectors:
  138. #headimg #name { }
  139. #headimg #desc { }
  140. */
  141. </style>
  142. <?php
  143. }
  144. endif;
  145. /**
  146. * Makes some changes to the <title> tag, by filtering the output of wp_title().
  147. *
  148. * If we have a site description and we're viewing the home page or a blog posts
  149. * page (when using a static front page), then we will add the site description.
  150. *
  151. * If we're viewing a search result, then we're going to recreate the title entirely.
  152. * We're going to add page numbers to all titles as well, to the middle of a search
  153. * result title and the end of all other titles.
  154. *
  155. * The site title also gets added to all titles.
  156. *
  157. * @since Twenty Ten 1.0
  158. *
  159. * @param string $title Title generated by wp_title()
  160. * @param string $separator The separator passed to wp_title(). Twenty Ten uses a
  161. * vertical bar, "|", as a separator in header.php.
  162. * @return string The new title, ready for the <title> tag.
  163. */
  164. function boilerplate_filter_wp_title( $title, $separator ) {
  165. // Don't affect wp_title() calls in feeds.
  166. if ( is_feed() )
  167. return $title;
  168. // The $paged global variable contains the page number of a listing of posts.
  169. // The $page global variable contains the page number of a single post that is paged.
  170. // We'll display whichever one applies, if we're not looking at the first page.
  171. global $paged, $page;
  172. if ( is_search() ) {
  173. // If we're a search, let's start over:
  174. $title = sprintf( __( 'Search results for %s', 'boilerplate' ), '"' . get_search_query() . '"' );
  175. // Add a page number if we're on page 2 or more:
  176. if ( $paged >= 2 )
  177. $title .= " $separator " . sprintf( __( 'Page %s', 'boilerplate' ), $paged );
  178. // Add the site name to the end:
  179. $title .= " $separator " . get_bloginfo( 'name', 'display' );
  180. // We're done. Let's send the new title back to wp_title():
  181. return $title;
  182. }
  183. // Otherwise, let's start by adding the site name to the end:
  184. $title .= get_bloginfo( 'name', 'display' );
  185. // If we have a site description and we're on the home/front page, add the description:
  186. $site_description = get_bloginfo( 'description', 'display' );
  187. if ( $site_description && ( is_home() || is_front_page() ) )
  188. $title .= " $separator " . $site_description;
  189. // Add a page number if necessary:
  190. if ( $paged >= 2 || $page >= 2 )
  191. $title .= " $separator " . sprintf( __( 'Page %s', 'boilerplate' ), max( $paged, $page ) );
  192. // Return the new title to wp_title():
  193. return $title;
  194. }
  195. add_filter( 'wp_title', 'boilerplate_filter_wp_title', 10, 2 );
  196. /**
  197. * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
  198. *
  199. * To override this in a child theme, remove the filter and optionally add
  200. * your own function tied to the wp_page_menu_args filter hook.
  201. *
  202. * @since Twenty Ten 1.0
  203. */
  204. function boilerplate_page_menu_args( $args ) {
  205. $args['show_home'] = true;
  206. return $args;
  207. }
  208. add_filter( 'wp_page_menu_args', 'boilerplate_page_menu_args' );
  209. /**
  210. * Sets the post excerpt length to 40 characters.
  211. *
  212. * To override this length in a child theme, remove the filter and add your own
  213. * function tied to the excerpt_length filter hook.
  214. *
  215. * @since Twenty Ten 1.0
  216. * @return int
  217. */
  218. function boilerplate_excerpt_length( $length ) {
  219. return 40;
  220. }
  221. add_filter( 'excerpt_length', 'boilerplate_excerpt_length' );
  222. /**
  223. * Returns a "Continue Reading" link for excerpts
  224. *
  225. * @since Twenty Ten 1.0
  226. * @return string "Continue Reading" link
  227. */
  228. function boilerplate_continue_reading_link() {
  229. return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'boilerplate' ) . '</a>';
  230. }
  231. /**
  232. * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and boilerplate_continue_reading_link().
  233. *
  234. * To override this in a child theme, remove the filter and add your own
  235. * function tied to the excerpt_more filter hook.
  236. *
  237. * @since Twenty Ten 1.0
  238. * @return string An ellipsis
  239. */
  240. function boilerplate_auto_excerpt_more( $more ) {
  241. return ' &hellip;' . boilerplate_continue_reading_link();
  242. }
  243. add_filter( 'excerpt_more', 'boilerplate_auto_excerpt_more' );
  244. /**
  245. * Adds a pretty "Continue Reading" link to custom post excerpts.
  246. *
  247. * To override this link in a child theme, remove the filter and add your own
  248. * function tied to the get_the_excerpt filter hook.
  249. *
  250. * @since Twenty Ten 1.0
  251. * @return string Excerpt with a pretty "Continue Reading" link
  252. */
  253. function boilerplate_custom_excerpt_more( $output ) {
  254. if ( has_excerpt() && ! is_attachment() ) {
  255. $output .= boilerplate_continue_reading_link();
  256. }
  257. return $output;
  258. }
  259. add_filter( 'get_the_excerpt', 'boilerplate_custom_excerpt_more' );
  260. /**
  261. * Remove inline styles printed when the gallery shortcode is used.
  262. *
  263. * Galleries are styled by the theme in Twenty Ten's style.css.
  264. *
  265. * @since Twenty Ten 1.0
  266. * @return string The gallery style filter, with the styles themselves removed.
  267. */
  268. function boilerplate_remove_gallery_css( $css ) {
  269. return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
  270. }
  271. add_filter( 'gallery_style', 'boilerplate_remove_gallery_css' );
  272. if ( ! function_exists( 'boilerplate_comment' ) ) :
  273. /**
  274. * Template for comments and pingbacks.
  275. *
  276. * To override this walker in a child theme without modifying the comments template
  277. * simply create your own boilerplate_comment(), and that function will be used instead.
  278. *
  279. * Used as a callback by wp_list_comments() for displaying the comments.
  280. *
  281. * @since Twenty Ten 1.0
  282. */
  283. function boilerplate_comment( $comment, $args, $depth ) {
  284. $GLOBALS['comment'] = $comment;
  285. switch ( $comment->comment_type ) :
  286. case '' :
  287. ?>
  288. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  289. <article id="comment-<?php comment_ID(); ?>">
  290. <div class="comment-author vcard">
  291. <?php echo get_avatar( $comment, 40 ); ?>
  292. <?php printf( __( '%s <span class="says">says:</span>', 'boilerplate' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
  293. </div><!-- .comment-author .vcard -->
  294. <?php if ( $comment->comment_approved == '0' ) : ?>
  295. <em><?php _e( 'Your comment is awaiting moderation.', 'boilerplate' ); ?></em>
  296. <br />
  297. <?php endif; ?>
  298. <footer class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
  299. <?php
  300. /* translators: 1: date, 2: time */
  301. printf( __( '%1$s at %2$s', 'boilerplate' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'boilerplate' ), ' ' );
  302. ?>
  303. </footer><!-- .comment-meta .commentmetadata -->
  304. <div class="comment-body"><?php comment_text(); ?></div>
  305. <div class="reply">
  306. <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  307. </div><!-- .reply -->
  308. </article><!-- #comment-## -->
  309. <?php
  310. break;
  311. case 'pingback' :
  312. case 'trackback' :
  313. ?>
  314. <li class="post pingback">
  315. <p><?php _e( 'Pingback:', 'boilerplate' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'boilerplate'), ' ' ); ?></p>
  316. <?php
  317. break;
  318. endswitch;
  319. }
  320. endif;
  321. /**
  322. * Register widgetized areas, including two sidebars and four widget-ready columns in the footer.
  323. *
  324. * To override boilerplate_widgets_init() in a child theme, remove the action hook and add your own
  325. * function tied to the init hook.
  326. *
  327. * @since Twenty Ten 1.0
  328. * @uses register_sidebar
  329. */
  330. function boilerplate_widgets_init() {
  331. // Area 1, located at the top of the sidebar.
  332. register_sidebar( array(
  333. 'name' => __( 'Primary Widget Area', 'boilerplate' ),
  334. 'id' => 'primary-widget-area',
  335. 'description' => __( 'The primary widget area', 'boilerplate' ),
  336. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  337. 'after_widget' => '</li>',
  338. 'before_title' => '<h3 class="widget-title">',
  339. 'after_title' => '</h3>',
  340. ) );
  341. // Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
  342. register_sidebar( array(
  343. 'name' => __( 'Secondary Widget Area', 'boilerplate' ),
  344. 'id' => 'secondary-widget-area',
  345. 'description' => __( 'The secondary widget area', 'boilerplate' ),
  346. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  347. 'after_widget' => '</li>',
  348. 'before_title' => '<h3 class="widget-title">',
  349. 'after_title' => '</h3>',
  350. ) );
  351. // Area 3, located in the footer. Empty by default.
  352. register_sidebar( array(
  353. 'name' => __( 'First Footer Widget Area', 'boilerplate' ),
  354. 'id' => 'first-footer-widget-area',
  355. 'description' => __( 'The first footer widget area', 'boilerplate' ),
  356. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  357. 'after_widget' => '</li>',
  358. 'before_title' => '<h3 class="widget-title">',
  359. 'after_title' => '</h3>',
  360. ) );
  361. // Area 4, located in the footer. Empty by default.
  362. register_sidebar( array(
  363. 'name' => __( 'Second Footer Widget Area', 'boilerplate' ),
  364. 'id' => 'second-footer-widget-area',
  365. 'description' => __( 'The second footer widget area', 'boilerplate' ),
  366. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  367. 'after_widget' => '</li>',
  368. 'before_title' => '<h3 class="widget-title">',
  369. 'after_title' => '</h3>',
  370. ) );
  371. // Area 5, located in the footer. Empty by default.
  372. register_sidebar( array(
  373. 'name' => __( 'Third Footer Widget Area', 'boilerplate' ),
  374. 'id' => 'third-footer-widget-area',
  375. 'description' => __( 'The third footer widget area', 'boilerplate' ),
  376. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  377. 'after_widget' => '</li>',
  378. 'before_title' => '<h3 class="widget-title">',
  379. 'after_title' => '</h3>',
  380. ) );
  381. // Area 6, located in the footer. Empty by default.
  382. register_sidebar( array(
  383. 'name' => __( 'Fourth Footer Widget Area', 'boilerplate' ),
  384. 'id' => 'fourth-footer-widget-area',
  385. 'description' => __( 'The fourth footer widget area', 'boilerplate' ),
  386. 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
  387. 'after_widget' => '</li>',
  388. 'before_title' => '<h3 class="widget-title">',
  389. 'after_title' => '</h3>',
  390. ) );
  391. }
  392. /** Register sidebars by running boilerplate_widgets_init() on the widgets_init hook. */
  393. add_action( 'widgets_init', 'boilerplate_widgets_init' );
  394. /**
  395. * Removes the default styles that are packaged with the Recent Comments widget.
  396. *
  397. * To override this in a child theme, remove the filter and optionally add your own
  398. * function tied to the widgets_init action hook.
  399. *
  400. * @since Twenty Ten 1.0
  401. */
  402. function boilerplate_remove_recent_comments_style() {
  403. global $wp_widget_factory;
  404. remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
  405. }
  406. add_action( 'widgets_init', 'boilerplate_remove_recent_comments_style' );
  407. if ( ! function_exists( 'boilerplate_posted_on' ) ) :
  408. /**
  409. * Prints HTML with meta information for the current post—date/time and author.
  410. *
  411. * @since Twenty Ten 1.0
  412. */
  413. function boilerplate_posted_on() {
  414. // BP: slight modification to Twenty Ten function, converting single permalink to multi-archival link
  415. // Y = 2012
  416. // F = September
  417. // m = 01–12
  418. // j = 1–31
  419. // d = 01–31
  420. printf( __( '<span class="%1$s">Posted on</span> <span class="entry-date">%2$s %3$s %4$s</span> <span class="meta-sep">by</span> %5$s', 'boilerplate' ),
  421. // %1$s = container class
  422. 'meta-prep meta-prep-author',
  423. // %2$s = month: /yyyy/mm/
  424. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  425. home_url() . '/' . get_the_date( 'Y' ) . '/' . get_the_date( 'm' ) . '/',
  426. esc_attr( 'View Archives for ' . get_the_date( 'F' ) . ' ' . get_the_date( 'Y' ) ),
  427. get_the_date( 'F' )
  428. ),
  429. // %3$s = day: /yyyy/mm/dd/
  430. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  431. home_url() . '/' . get_the_date( 'Y' ) . '/' . get_the_date( 'm' ) . '/' . get_the_date( 'd' ) . '/',
  432. esc_attr( 'View Archives for ' . get_the_date( 'F' ) . ' ' . get_the_date( 'j' ) . ' ' . get_the_date( 'Y' ) ),
  433. get_the_date( 'j' )
  434. ),
  435. // %4$s = year: /yyyy/
  436. sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
  437. home_url() . '/' . get_the_date( 'Y' ) . '/',
  438. esc_attr( 'View Archives for ' . get_the_date( 'Y' ) ),
  439. get_the_date( 'Y' )
  440. ),
  441. // %5$s = author vcard
  442. sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
  443. get_author_posts_url( get_the_author_meta( 'ID' ) ),
  444. sprintf( esc_attr__( 'View all posts by %s', 'boilerplate' ), get_the_author() ),
  445. get_the_author()
  446. )
  447. );
  448. }
  449. endif;
  450. if ( ! function_exists( 'boilerplate_posted_in' ) ) :
  451. /**
  452. * Prints HTML with meta information for the current post (category, tags and permalink).
  453. *
  454. * @since Twenty Ten 1.0
  455. */
  456. function boilerplate_posted_in() {
  457. // Retrieves tag list of current post, separated by commas.
  458. $tag_list = get_the_tag_list( '', ', ' );
  459. if ( $tag_list ) {
  460. $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'boilerplate' );
  461. } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
  462. $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'boilerplate' );
  463. } else {
  464. $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'boilerplate' );
  465. }
  466. // Prints the string, replacing the placeholders.
  467. printf(
  468. $posted_in,
  469. get_the_category_list( ', ' ),
  470. $tag_list,
  471. get_permalink(),
  472. the_title_attribute( 'echo=0' )
  473. );
  474. }
  475. endif;
  476. /* Begin Boilerplate */
  477. // Add Admin
  478. require_once(TEMPLATEPATH . '/boilerplate-admin/admin-menu.php');
  479. // remove version info from head and feeds (http://digwp.com/2009/07/remove-wordpress-version-number/)
  480. function boilerplate_complete_version_removal() {
  481. return '';
  482. }
  483. add_filter('the_generator', 'boilerplate_complete_version_removal');
  484. /* End Boilerplate */
  485. // change Search Form input type from "text" to "search" and add placeholder text
  486. function boilerplate_search_form ( $form ) {
  487. $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
  488. <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
  489. <input type="search" placeholder="Search for..." value="' . get_search_query() . '" name="s" id="s" />
  490. <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
  491. </div>
  492. </form>';
  493. return $form;
  494. }
  495. add_filter( 'get_search_form', 'boilerplate_search_form' );
  496. // added per WP upload process request
  497. if ( function_exists( 'add_theme_support' ) ) {
  498. add_theme_support( 'post-thumbnails' );
  499. }
  500. ?>