functions.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. if ( ! function_exists( 'dw_setup' ) ):
  3. function dw_setup() {
  4. require( get_template_directory() . '/inc/template.php' );
  5. require( get_template_directory() . '/inc/tweaks.php' );
  6. }
  7. endif;
  8. add_action( 'after_setup_theme', 'dw_setup' );
  9. add_theme_support( 'post-thumbnails' );
  10. set_post_thumbnail_size( 150, 150, true );
  11. add_image_size( 'post-large', 770, 577, true );
  12. add_theme_support( 'automatic-feed-links' );
  13. add_theme_support( 'menus' );
  14. function dw_scripts() {
  15. global $post;
  16. wp_deregister_script('jquery');
  17. wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), false, true);
  18. wp_enqueue_script( 'jquery', '', '', '', true );
  19. wp_enqueue_style( 'style', get_stylesheet_uri() );
  20. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
  21. wp_enqueue_script( 'comment-reply' );
  22. }
  23. }
  24. add_action( 'wp_enqueue_scripts', 'dw_scripts' );
  25. function dw_editor() {
  26. //add_editor_style( 'style.css' );
  27. }
  28. add_action( 'init', 'dw_editor' );
  29. $comments_args = array(
  30. 'comment_notes_after' => '',
  31. 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
  32. 'comment_field' => '<p class="comment-form-comment">...',
  33. 'must_log_in' => '<p class="must-log-in">...',
  34. 'logged_in_as' => '<p class="logged-in-as">...',
  35. 'comment_notes_before' => '<p class="comment-notes">...',
  36. //'comment_notes_after' => '<dl class="form-allowed-tags">...',
  37. 'id_form' => 'commentform',
  38. 'id_submit' => 'submit',
  39. 'title_reply' => __( 'Leave a Reply' ),
  40. 'title_reply_to' => __( 'Leave a Reply to %s' ),
  41. 'cancel_reply_link' => __( 'Cancel reply' ),
  42. 'label_submit' => __( 'Post Comment' ),
  43. );
  44. comment_form($comments_args);
  45. function dw_ping($comment, $args, $depth) {
  46. }
  47. ?>