functions.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. if ( ! function_exists( 'dw_setup' ) ):
  3. function dw_setup() {
  4. require( get_template_directory() . '/inc/template.php' );
  5. }
  6. endif;
  7. add_action( 'after_setup_theme', 'dw_setup' );
  8. remove_action('wp_head', 'index_rel_link' );
  9. remove_action('wp_head', 'rel_canonical');
  10. remove_action('wp_head', 'start_post_rel_link', 10, 0 );
  11. remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
  12. remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
  13. remove_action('wp_head', 'parent_post_rel_link', 10, 0 );
  14. remove_action('wp_head', 'rsd_link');
  15. remove_action('wp_head', 'wlwmanifest_link');
  16. remove_action('wp_head', 'wp_generator');
  17. remove_action('wp_head', 'feed_links_extra', 3 );
  18. remove_action('wp_head', 'feed_links', 2 );
  19. add_editor_style();
  20. add_theme_support( 'post-thumbnails' );
  21. set_post_thumbnail_size( 150, 150, true );
  22. add_image_size( 'post-tiny', 100, 100, true );
  23. add_image_size( 'post-medium', 250, 175, true );
  24. add_image_size( 'post-large', 770, 577, true );
  25. add_theme_support( 'automatic-feed-links' );
  26. add_theme_support( 'menus' );
  27. function dw_remove_wp_ver_css_js( $src ) {
  28. if ( strpos( $src, 'ver=' ) )
  29. $src = remove_query_arg( 'ver', $src );
  30. return $src;
  31. }
  32. add_filter( 'style_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
  33. add_filter( 'script_loader_src', 'dw_remove_wp_ver_css_js', 9999 );
  34. add_action( 'wp_enqueue_scripts', 'dw_scripts' );
  35. function dw_scripts() {
  36. global $post;
  37. wp_enqueue_style( 'style', get_stylesheet_uri() );
  38. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
  39. wp_enqueue_script( 'comment-reply' );
  40. }
  41. }
  42. ?>