Advertisement
pjeaje

comments.php

Apr 15th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5.60 KB | None | 0 0
  1. <?php
  2. /**
  3. * The template for displaying Comments.
  4. *
  5. * The area of the page that contains both current comments
  6. * and the comment form. The actual display of comments is
  7. * handled by a callback to generate_comment() which is
  8. * located in the inc/template-tags.php file.
  9. *
  10. * @package GeneratePress
  11. */
  12.  
  13. /*
  14. * If the current post is protected by a password and
  15. * the visitor has not yet entered the password we will
  16. * return early without loading the comments
  17. */
  18. if ( post_password_required() )
  19.     return;
  20. ?>
  21.  
  22.     <div id="comments">
  23.  
  24.     <?php // You can start editing here -- including this comment! ?>
  25.  
  26.     <?php if ( have_comments() ) : ?>
  27.         <h3 class="comments-title">
  28.             Comments for job #<?php the_ID(); ?>
  29.         </h3>
  30. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
  31.     <div class="inside-article">
  32.         <?php do_action( 'generate_before_content'); ?>
  33.        
  34. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  35. <!-- sandgroper -->
  36. <ins class="adsbygoogle"
  37.     style="display:block"
  38.     data-ad-client="ca-pub-3761760999645154"
  39.     data-ad-slot="4393725687"
  40.     data-ad-format="auto"></ins>
  41. <script>
  42. (adsbygoogle = window.adsbygoogle || []).push({});
  43. </script><br />
  44.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  45.         <nav id="comment-nav-above" class="comment-navigation" role="navigation">
  46.             <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'generate' ); ?></h1>
  47.             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'generate' ) ); ?></div>
  48.             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'generate' ) ); ?></div>
  49.         </nav><!-- #comment-nav-above -->
  50.         <?php endif; // check for comment navigation ?>
  51.  
  52.         <ol class="comment-list">
  53.             <?php
  54.                 /* Loop through and list the comments. Tell wp_list_comments()
  55.                  * to use generate_comment() to format the comments.
  56.                  * If you want to override this in a child theme, then you can
  57.                  * define generate_comment() and that will be used instead.
  58.                  * See generate_comment() in inc/template-tags.php for more.
  59.                  */
  60.                 wp_list_comments( array(
  61.                     'callback' => 'generate_comment'
  62.                 ) );
  63.             ?>
  64.         </ol><!-- .comment-list -->
  65.  
  66.         <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
  67.         <nav id="comment-nav-below" class="comment-navigation" role="navigation">
  68.             <h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'generate' ); ?></h1>
  69.             <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'generate' ) ); ?></div>
  70.             <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'generate' ) ); ?></div>
  71.         </nav><!-- #comment-nav-below -->
  72.         <?php endif; // check for comment navigation ?>
  73.  
  74.     <?php endif; // have_comments() ?>
  75.  
  76.     <?php
  77.         // If comments are closed and there are comments, let's leave a little note, shall we?
  78.         if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
  79.     ?>
  80.         <p class="no-comments"><p><?php the_author(); ?> is no longer receiving applications/comments for this job. If you need to contact the school please contact them directly.</p>
  81.         </p>
  82.         <?php echo get_post_meta($post->ID, 'school_phone', true); ?>
  83.  
  84.    
  85.        
  86.     <?php endif;
  87.  
  88.     $commenter = wp_get_current_commenter();
  89.     $fields = array(
  90.         'author' => '<input placeholder="' . __( 'Name','generate' ) . ' *" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" />',
  91.         'email' => '<input placeholder="' . __( 'Email','generate' ) . ' *" id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" />',
  92.         'url' => '<input placeholder="' . __( 'Website','generate' ) . '" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />',
  93.     );
  94.     $defaults = array(
  95.         'fields'        => apply_filters( 'comment_form_default_fields', $fields ),
  96.         'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="2" aria-required="true"></textarea></p>',
  97.         'must_log_in'   => '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.','generate' ), wp_login_url( get_permalink() ) ) . '</p>',
  98.         'logged_in_as'  => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="http://sandgroper.net/?page_id=48">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>','generate' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( get_permalink() ) ) . '</p>',
  99.         'comment_notes_before' => null,
  100.         'comment_notes_after'  => null,
  101.         'id_form'              => 'commentform',
  102.         'id_submit'            => 'submit',
  103.         'title_reply'          => apply_filters( 'generate_leave_comment', __( '<br  /><strong>Comments</strong>','generate' ) ),
  104.         'title_reply_to'       => apply_filters( 'generate_leave_reply', __( 'Leave a Reply to %s','generate' ) ),
  105.         'cancel_reply_link'    => apply_filters( 'generate_cancel_reply', __( 'Cancel reply','generate' ) ),
  106.         'label_submit'         => apply_filters( 'generate_post_comment', __( 'Submit','generate' ) ),
  107.     );
  108.     comment_form($defaults);
  109.     ?>
  110. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_article_schema( 'BlogPosting' ); ?>>
  111.     <div class="inside-article">
  112.         <?php do_action( 'generate_before_content'); ?>
  113.        
  114. </div><!-- #comments -->
  115.  
  116. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement