Guest User

Untitled

a guest
Jun 20th, 2018
22
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php if ( post_password_required() ) : ?>
  2. <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'appointment' ); ?></p>
  3. <?php return; endif;
  4. // code for comment
  5. if ( ! function_exists( 'appointment_comment' ) ) {
  6. function appointment_comment( $comment, $args, $depth )
  7. {
  8. $GLOBALS['comment'] = $comment;
  9. //get theme data
  10. global $comment_data;
  11. //translations
  12. $leave_reply = $comment_data['translation_reply_to_coment'] ? $comment_data['translation_reply_to_coment'] : __('Reply','appointment');
  13. ?>
  14.  
  15. <div <?php comment_class('media comment-box'); ?> id="comment-<?php comment_ID(); ?>">
  16. <a class="pull-left-comment" href="<?php the_author_meta('user_url'); ?>">
  17. <?php echo get_avatar( $comment , 70); ?>
  18. </a>
  19. <div class="media-body">
  20. <div class="comment-detail">
  21. <div class="reply">
  22. <?php comment_reply_link(array_merge( $args, array('reply_text' => $leave_reply,'depth' => $depth, 'max_depth' => $args['max_depth'], 'per_page' => $args['per_page']))) ?>
  23. </div>
  24. <h4 class="comment-detail-title"><?php comment_author(); ?><span class="comment-date"><a href="<?php echo get_comment_link( $comment->comment_ID );?>"><?php _e('Posted on', 'appointment'); ?><?php echo comment_time('g:i a'); ?><?php echo " - "; echo comment_date('M j, Y');?></a></span></h4>
  25. <p><?php comment_text(); ?></p>
  26. <?php edit_comment_link( __( 'Edit', 'appointment' ), '<p class="edit-link">', '</p>' ); ?>
  27.  
  28. <?php if ( $comment->comment_approved == '0' ) : ?>
  29. <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'appointment' ); ?></em>
  30. <br/>
  31. <?php endif; ?>
  32.  
  33. </div>
  34. </div>
  35. </div>
  36. <?php } }// end of appointment_comment function
  37. if ( have_comments() ) { ?>
  38.  
  39. <div class="comment-section">
  40. <div class="comment-title"><h3></i> <?php comments_number ( '% ' . __('comments so far','appointment') ); ?> </h3>
  41. </div>
  42. <?php wp_list_comments( array( 'callback' => 'appointment_comment' ) ); ?>
  43. </div> <!---comment_section--->
  44.  
  45. <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { ?>
  46. <nav id="comment-nav-below">
  47. <h1 class="assistive-text"><?php _e( 'Comment navigation', 'appointment' ); ?></h1>
  48. <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'appointment' ) ); ?></div>
  49. <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'appointment' ) ); ?></div>
  50. </nav>
  51. <?php }
  52. if ( ! comments_open() && get_comments_number() ) : ?>
  53. <p class="nocomments"><?php _e( 'Comments are closed.' , 'appointment' ); ?></p>
  54. <?php endif; } ?>
  55. <?php if ('open' == $post->comment_status) { ?>
  56. <?php if ( get_option('comment_registration') && !$user_ID ) { ?>
  57. <p><?php echo sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.','appointment' ), site_url( 'wp-login.php' ) . '?redirect_to=' . urlencode(get_permalink())); ?></p>
  58. <?php } else {
  59. ?>
  60. <div class="comment-form-section">
  61.  
  62. <?php
  63. $fields=array(
  64. 'author' => ' <div class="blog-form-group"><input class="blog-form-control" name="author" id="author" value="" type="name" placeholder="'.__('Name','appointment').'" /></div>',
  65. 'email' => '<div class="blog-form-group"><input class="blog-form-control" name="email" id="email" value="" type="email" placeholder="'.__('Email','appointment').'" /></div>',
  66. );
  67. function appointment_fields($fields) {
  68. return $fields;
  69. }
  70. add_filter('comment_form_default_fields','appointment_fields');
  71. $defaults = array(
  72. 'fields'=> apply_filters( 'comment_form_default_fields', $fields ),
  73. 'comment_field'=> '<div class="blog-form-group-textarea" >
  74. <textarea id="comments" rows="7" class="blog-form-control-textarea" name="comment" type="text" placeholder="'.__('Leave your message','appointment').'"></textarea></div>',
  75. 'logged_in_as' => '<p class="blog-post-info-detail">' . __("Logged in as",'appointment' ).' '.'<a href="'. admin_url( 'profile.php' ).'">'.$user_identity.'</a>'. '<a href="'. wp_logout_url( get_permalink() ).'" title="'.__('Log out from this Account','appointment').'">'.' '.__("Log out",'appointment').'?</a>' . '</p>',
  76. 'id_submit'=> 'blogdetail-btn',
  77. 'label_submit'=>__('Send Message','appointment'),
  78. 'comment_notes_after'=> '',
  79. 'comment_notes_before' => '',
  80. 'title_reply'=> '<div class="comment-title"><h3>'.__('Leave a Reply', 'appointment').'</h3></div>',
  81. 'id_form'=> 'commentform'
  82. );
  83. ob_start();
  84. comment_form($defaults);
  85. echo str_replace('class="comment-form"','class="form-inline"',ob_get_clean());
  86.  
  87. ?>
  88. </div>
  89. <?php } } ?>
RAW Paste Data