Advertisement
Guest User

Untitled

a guest
May 4th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. <?php
  2.  
  3. if ( ! isset( $content_width ) )
  4. $content_width = 940;
  5.  
  6. function register_my_menu() {
  7. register_nav_menu('primary',__( 'Primary Menu' ));
  8. register_nav_menu('footer',__( 'Footer Menu' ));
  9. }
  10.  
  11. add_action( 'init', 'register_my_menu' );
  12.  
  13.  
  14. function simple_rabbit_widgets_init() {
  15. register_sidebar( array(
  16. 'name' => __( 'Main Sidebar', 'simple-rabbit' ),
  17. 'id' => 'sidebar-0',
  18. 'description' => __( 'Appears on all pages', 'simple-rabbit' ),
  19. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  20. 'after_widget' => '</div>',
  21. 'before_title' => '<h3 class="widget-title">',
  22. 'after_title' => '</h3>',
  23. ) );
  24. register_sidebar( array(
  25. 'name' => __( 'Footer Widget Area', 'simple-rabbit' ),
  26. 'id' => 'sidebar-1',
  27. 'description' => __( 'Appears on all pages', 'simple-rabbit' ),
  28. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  29. 'after_widget' => '</div>',
  30. 'before_title' => '<h3 class="widget-title">',
  31. 'after_title' => '</h3>',
  32. ) );
  33. }
  34.  
  35. add_action( 'widgets_init', 'simple_rabbit_widgets_init' );
  36.  
  37. wp_register_style( 'mainstyle', get_stylesheet_uri());
  38. wp_enqueue_style( 'mainstyle', get_stylesheet_uri());
  39.  
  40. /*
  41. * Loads the Options Panel
  42. *
  43. * If you're loading from a child theme use stylesheet_directory
  44. * instead of template_directory
  45. */
  46.  
  47. if ( !function_exists( 'optionsframework_init' ) ) {
  48. define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' );
  49. require_once dirname( __FILE__ ) . '/inc/options-framework.php';
  50. }
  51.  
  52. /*
  53. * This is an example of how to add custom scripts to the options panel.
  54. * This one shows/hides the an option when a checkbox is clicked.
  55. *
  56. * You can delete it if you not using that option
  57. */
  58.  
  59. add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
  60.  
  61.  
  62.  
  63. function twentytwelve_comment( $comment, $args, $depth ) {
  64. $GLOBALS['comment'] = $comment;
  65. switch ( $comment->comment_type ) :
  66. case 'pingback' :
  67. case 'trackback' :
  68. // Display trackbacks differently than normal comments.
  69. ?>
  70.  
  71. <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
  72. <p>
  73. <?php _e( 'Pingback:', 'twentytwelve' ); ?>
  74. <?php comment_author_link(); ?>
  75. <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
  76. </p>
  77. <?php
  78. break;
  79. default :
  80. // Proceed with normal comments.
  81. global $post;
  82. ?>
  83. <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
  84. <article id="comment-<?php comment_ID(); ?>" class="comment">
  85. <header class="comment-meta comment-author vcard">
  86. <?php
  87. echo get_avatar( $comment, 44 );
  88. printf( '<cite class="fn">%1$s %2$s</cite>',
  89. get_comment_author_link(),
  90. // If current post author is also comment author, make it known visually.
  91. ( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'twentytwelve' ) . '</span>' : '');
  92. printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
  93. esc_url( get_comment_link( $comment->comment_ID ) ),
  94. get_comment_time( 'c' ),
  95. /* translators: 1: date, 2: time */
  96. sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
  97. );
  98. ?>
  99. </header>
  100. <!-- .comment-meta -->
  101.  
  102. <?php if ( '0' == $comment->comment_approved ) : ?>
  103. <p class="comment-awaiting-moderation">
  104. <?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?>
  105. </p>
  106. <?php endif; ?>
  107. <section class="comment-content comment">
  108. <?php comment_text(); ?>
  109. <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?>
  110. </section>
  111. <!-- .comment-content -->
  112.  
  113. <div class="reply">
  114. <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  115. </div>
  116. <!-- .reply -->
  117.  
  118. </article>
  119. <!-- #comment-## -->
  120.  
  121. <?php
  122. break;
  123. endswitch; // end comment_type check
  124. }
  125.  
  126. function optionsframework_custom_scripts() { ?>
  127. <script type="text/javascript">
  128. jQuery(document).ready(function() {
  129.  
  130. jQuery('#example_showhidden').click(function() {
  131. jQuery('#section-example_text_hidden').fadeToggle(400);
  132. });
  133.  
  134. if (jQuery('#example_showhidden:checked').val() !== undefined) {
  135. jQuery('#section-example_text_hidden').show();
  136. }
  137.  
  138. });
  139. </script>
  140. <?php
  141. }
  142.  
  143. function simple_rabbit_scripts_styles() {
  144.  
  145. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
  146. wp_enqueue_script( 'comment-reply' );
  147.  
  148. }
  149. add_action( 'wp_enqueue_scripts', 'simple_rabbit_scripts_styles' );
  150.  
  151. add_theme_support( 'automatic-feed-links' );
  152.  
  153. add_action( 'wp_enqueue_scripts', function() {
  154. wp_register_style( 'mainstyle', get_stylesheet_uri());
  155. wp_enqueue_style( 'mainstyle', get_stylesheet_uri());
  156. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement