comments_by_type['comment'] ) && have_comments() ) { genesis_markup( array( 'open' => '
', 'context' => 'entry-comments', ) ); echo apply_filters( 'genesis_title_comments', __( '

Comments

', 'genesis' ) ); printf( '
    ', genesis_attr( 'comment-list' ) ); /** * Fires inside comments list markup. * * @since 1.0.0 */ do_action( 'genesis_list_comments' ); echo '
'; // Comment Navigation. $prev_link = get_previous_comments_link( apply_filters( 'genesis_prev_comments_link_text', '' ) ); $next_link = get_next_comments_link( apply_filters( 'genesis_next_comments_link_text', '' ) ); if ( $prev_link || $next_link ) { $pagination = sprintf( '
%s
', $prev_link ); $pagination .= sprintf( '
%s
', $next_link ); genesis_markup( array( 'open' => '
', 'close' => '
', 'content' => $pagination, 'context' => 'comments-pagination', ) ); } genesis_markup( array( 'close' => '
', 'context' => 'entry-comments', ) ); } // No comments so far. elseif ( 'open' === get_post()->comment_status && $no_comments_text = apply_filters( 'genesis_no_comments_text', '' ) ) { if ( genesis_html5() ) { echo sprintf( '
', genesis_attr( 'entry-comments' ) ) . $no_comments_text . '
'; } else { echo '
' . $no_comments_text . '
'; } } elseif ( $comments_closed_text = apply_filters( 'genesis_comments_closed_text', '' ) ) { if ( genesis_html5() ) { echo sprintf( '
', genesis_attr( 'entry-comments' ) ) . $comments_closed_text . '
'; } else { echo '
' . $comments_closed_text . '
'; } } } add_action( 'genesis_pings', 'genesis_do_pings' ); /** * Echo Genesis default trackback structure. * * Does the `genesis_list_args` action. * * Applies the `genesis_no_pings_text` filter. * * @since 1.1.2 * * @global WP_Query $wp_query Query object. * * @return void Return early if on a page with Genesis page trackbacks off, or on a * post with Genesis post trackbacks off. */ function genesis_do_pings() { global $wp_query; // Bail if trackbacks are off for this post type. if ( ( is_page() && ! genesis_get_option( 'trackbacks_pages' ) ) || ( is_single() && ! genesis_get_option( 'trackbacks_posts' ) ) ) { return; } // If have pings. if ( ! empty( $wp_query->comments_by_type['pings'] ) && have_comments() ) { if ( empty( $wp_query->comments_by_type['comment'] ) && ! has_filter( 'genesis_no_comments_text' ) ) { add_filter( 'genesis_attr_entry-pings', 'genesis_attributes_entry_comments' ); } genesis_markup( array( 'open' => '
', 'context' => 'entry-pings', ) ); echo apply_filters( 'genesis_title_pings', __( '

Trackbacks

', 'genesis' ) ); echo '
    '; /** * Fires inside the pings list markup. * * @since 1.0.0 */ do_action( 'genesis_list_pings' ); echo '
'; genesis_markup( array( 'close' => '
', 'context' => 'entry-pings', ) ); } else { echo apply_filters( 'genesis_no_pings_text', '' ); } } add_action( 'genesis_list_comments', 'genesis_default_list_comments' ); /** * Output the list of comments. * * Applies the `genesis_comment_list_args` filter. * * @since 1.0.0 * * @see genesis_html5_comment_callback() HTML5 callback. * @see genesis_comment_callback() XHTML callback. */ function genesis_default_list_comments() { $defaults = array( 'type' => 'comment', 'avatar_size' => 48, 'format' => 'html5', // Not necessary, but a good example. 'callback' => genesis_html5() ? 'genesis_html5_comment_callback' : 'genesis_comment_callback', ); $args = apply_filters( 'genesis_comment_list_args', $defaults ); wp_list_comments( $args ); } add_action( 'genesis_list_pings', 'genesis_default_list_pings' ); /** * Output the list of trackbacks. * * Applies the `genesis_ping_list_args` filter. * * @since 1.0.0 */ function genesis_default_list_pings() { $args = apply_filters( 'genesis_ping_list_args', array( 'type' => 'pings', ) ); wp_list_comments( $args ); } /** * Comment callback for {@link genesis_default_list_comments()} if HTML5 is not active. * * Does `genesis_before_comment` and `genesis_after_comment` actions. * * Applies `comment_author_says_text` and `genesis_comment_awaiting_moderation` filters. * * @since 1.0.0 * * @param stdClass $comment Comment object. * @param array $args Comment args. * @param int $depth Depth of current comment. */ function genesis_comment_callback( $comment, array $args, $depth ) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    %1$s %2$s:', 'genesis' ), get_comment_author_link(), apply_filters( 'comment_author_says_text', __( 'says', 'genesis' ) ) ); ?>
    comment_approved ) : ?>

    $depth, 'max_depth' => $args['max_depth'], ) ) ); ?>
    tag because of comment threading. } /** * Comment callback for {@link genesis_default_list_comments()} if HTML5 is active. * * Does `genesis_before_comment` and `genesis_after_comment` actions. * * Applies `comment_author_says_text` and `genesis_comment_awaiting_moderation` filters. * * @since 2.0.0 * * @param stdClass $comment Comment object. * @param array $args Comment args. * @param int $depth Depth of current comment. */ function genesis_html5_comment_callback( $comment, array $args, $depth ) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    >
    >

    > %s', esc_url( $url ), genesis_attr( 'comment-author-link' ), $author ); } /** * Filter the "comment author says" text. * * Allows developer to filter the "comment author says" text so it can say something different, or nothing at all. * * @since unknown * * @param string $text Comment author says text. */ $comment_author_says_text = apply_filters( 'comment_author_says_text', __( 'says', 'genesis' ) ); if ( ! empty( $comment_author_says_text ) ) { $comment_author_says_text = '' . $comment_author_says_text . ''; } printf( '%s %s', $author, $comment_author_says_text ); ?>

    ', genesis_attr( 'comment-meta' ) ); printf( '

    '; } edit_comment_link( __( '(Edit)', 'genesis' ), ' ' ); ?>
    > comment_approved ) : ?>

    $depth, 'before' => sprintf( '
    ', genesis_attr( 'comment-reply' ) ), 'after' => '
    ', ) ) ); ?>
    tag because of comment threading. } add_action( 'genesis_comment_form', 'genesis_do_comment_form' ); /** * Optionally show the comment form. * * Genesis asks WP for the HTML5 version of the comment form - it uses {@link genesis_comment_form_args()} to revert to * XHTML form fields when child theme does not support HTML5. * * @since 1.0.0 * * @return void Return early if comments are closed via Genesis for this page or post. */ function genesis_do_comment_form() { // Bail if comments are closed for this post type. if ( ( is_page() && ! genesis_get_option( 'comments_pages' ) ) || ( is_single() && ! genesis_get_option( 'comments_posts' ) ) ) { return; } comment_form( array( 'format' => 'html5', ) ); } add_filter( 'comment_form_defaults', 'genesis_comment_form_args' ); /** * Filter the default comment form arguments, used by `comment_form()`. * * Applies only to XHTML child themes, since Genesis uses default HTML5 comment form where possible. * * Applies `genesis_comment_form_args` filter. * * @since 1.8.0 * * @global string $user_identity Display name of the user. * * @param array $defaults Comment form default arguments. * @return array Filtered comment form default arguments. */ function genesis_comment_form_args( array $defaults ) { // Use WordPress default HTML5 comment form if themes supports HTML5. if ( genesis_html5() ) { return $defaults; } global $user_identity; $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? ' aria-required="true"' : '' ); $author = '

    ' . '' . ' ' . ( $req ? '*' : '' ) . '

    '; $email = '

    ' . '' . ' ' . ( $req ? '*' : '' ) . '

    '; $url = '

    ' . '' . '' . '

    '; $comment_field = '

    ' . '' . '

    '; $args = array( 'comment_field' => $comment_field, 'title_reply' => __( 'Speak Your Mind', 'genesis' ), 'comment_notes_before' => '', 'comment_notes_after' => '', 'fields' => array( 'author' => $author, 'email' => $email, 'url' => $url, ), ); // Merge $args with $defaults. $args = wp_parse_args( $args, $defaults ); // Return filterable array of $args, along with other optional variables. return apply_filters( 'genesis_comment_form_args', $args, $user_identity, get_the_ID(), $commenter, $req, $aria_req ); } add_filter( 'get_comments_link', 'genesis_comments_link_filter', 10, 2 ); /** * Filter the comments link. If post has comments, link to #comments div. If no, link to #respond div. * * @since 2.0.1 * * @param string $link Post comments permalink with '#comments' appended. * @param int|WP_Post $post_id Post ID or WP_Post object. * @return string URL to comments if they exist, otherwise URL to the comment form. */ function genesis_comments_link_filter( $link, $post_id ) { if ( 0 == get_comments_number() ) { return get_permalink( $post_id ) . '#respond'; } return $link; }