WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] New comment form issue

[Resolved] New comment form issue

  • I have troubles with the header in the new comment form.

    I have the following in my function php:

    <header class="comment-meta comment-author vcard">
    				<?php
    					echo get_avatar( $comment, 44 );
    					printf( '<cite class="fn">%1$s %2$s</cite>',
    						get_comment_author_link(),
    						// If current post author is also comment author, make it known visually.
    						( $comment->user_id === $post-> post_author ) ? '<span class="commentAuthor"> ' . __( 'Post author', 'my_blog_name_here' ) . '</span>' : ''
    					);
    					printf( '<a href="%1$s"><br /><time datetime="%2$s">%3$s</time></a>',
    						esc_url( get_comment_link( $comment->comment_ID ) ),
    						get_comment_time( 'c' ),
    						/* translators: 1: date, 2: time */
    						sprintf( __( '%1$s', 'my_blog_name_here' ), get_comment_date() )
    					);
    				?>
    			</header>

    What I want is to:

      Remove the difference between the post author and everyone else.
      Have the (output of the ) author and the date of comment in two lines.
      Have the author and the date in two different < span class=”” >
      To be sure I haven’t messed up the above code already.

    Would anyone please look into this and help out. I have really really tried the best myself already….

    Regards,

    🙂

    *****

    I build the theme at local server, but it is partly live @ http://www.michaelsweightlosstips.com/test-article-1

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    @bcworkz

    This should work for you, but it is untested.

    <header class="comment-meta comment-author vcard">
    				<?php
    					echo get_avatar( $comment, 44 );
    					printf( '<span class=""><cite class="fn">%1$s</cite></span><br>', get_comment_author_link() );
    					printf( '<span class=""><a href="%1$s"><time datetime="%2$s">%3$s</time></a></span>',
    						esc_url( get_comment_link( $comment->comment_ID ) ),
    						get_comment_time( 'c' ),
    						/* translators: 1: date, 2: time */
    						sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
    					);
    				?>
    			</header>

    bcworkz,

    Absolutely great, thank you!

    The cleaned up code you provided has solved my problem, and has been sent to work.

    Regards,

    Michael

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] New comment form issue’ is closed to new replies.
Skip to toolbar