Advertisement
Guest User

functions.php code

a guest
Aug 24th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. <?php
  2.  
  3. /* ========================================================================================================================
  4.  
  5. Required external files
  6.  
  7. ======================================================================================================================== */
  8.  
  9. require_once( 'external/starkers-utilities.php' );
  10.  
  11.  
  12. /* ========================================================================================================================
  13.  
  14. Actions and Filters
  15.  
  16. ======================================================================================================================== */
  17.  
  18. add_action( 'wp_enqueue_scripts', 'script_enqueuer' );
  19.  
  20. add_filter( 'body_class', 'add_slug_to_body_class' );
  21.  
  22. /* ========================================================================================================================
  23.  
  24. Custom Post Types - include custom post types and taxonimies here e.g.
  25.  
  26. e.g. require_once( 'custom-post-types/your-custom-post-type.php' );
  27.  
  28. ======================================================================================================================== */
  29.  
  30.  
  31.  
  32. /* ========================================================================================================================
  33.  
  34. Scripts
  35.  
  36. ======================================================================================================================== */
  37.  
  38. /**
  39. * Add scripts via wp_head()
  40. *
  41. * @return void
  42. * @author Keir Whitaker
  43. */
  44.  
  45. function script_enqueuer() {
  46. wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) );
  47. wp_enqueue_script( 'site' );
  48.  
  49. wp_register_style( 'screen', get_template_directory_uri().'/style.css', '', '', 'screen' );
  50. wp_enqueue_style( 'screen' );
  51. }
  52.  
  53. /* ========================================================================================================================
  54.  
  55. Comments
  56.  
  57. ======================================================================================================================== */
  58.  
  59. /**
  60. * Custom callback for outputting comments
  61. *
  62. * @return void
  63. * @author Keir Whitaker
  64. */
  65. function starkers_comment( $comment, $args, $depth ) {
  66. $GLOBALS['comment'] = $comment;
  67. ?>
  68. <?php if ( $comment->comment_approved == '1' ): ?>
  69. <li>
  70. <article id="comment-<?php comment_ID() ?>">
  71. <?php echo get_avatar( $comment ); ?>
  72. <h4><?php comment_author_link() ?></h4>
  73. <time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time>
  74. <?php comment_text() ?>
  75. </article>
  76. <?php endif; ?>
  77. </li>
  78. <?php
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement