Tagged: x
-
AuthorPosts
-
January 8, 2017 at 8:53 am #1321106
c1sParticipantHi, I am trying to achieve a look of the Reply button as shown in the attached picture. I have tried
.comment-reply-link-after::before{ content: "\A"; white-space: pre; padding: -10px -10px 0 0 !important; }but that unfortunately doesn’t do the job.
Could you help me with this please?
Thanks!!January 8, 2017 at 8:54 am #1321108
c1sParticipantThis reply has been marked as private.January 8, 2017 at 9:29 am #1321125
RupokMemberHi there,
Thanks for writing in! Padding can not be negative and I am not sure what you are trying with the code. If you are trying to center the icon below avatar, then you can try this CSS :
.comment-reply-link .x-icon-reply { display: block; font-size: 16px; margin: 0 auto; width: 20px; }Cheers!
January 8, 2017 at 10:33 am #1321167
c1sParticipantGreat, thanks!
One more question, on the same post page there are three items i cannot find in “Poedit” (i have set up de_DE.mo and de_DE.po in themes/x-child/languages and it works fine for all the other items):
1) “COMMENTS” (meta below post heading) -> should be “2 Kommentare” (singular: “1 Kommentar”)
2) “EDIT” (right upper corner of commentary) -> should be “Editieren”
3) “01.08.2017 AT 17:18” (meta of commentary) -> should be “01.08.2017 UM 17:18”Do you know why it is not possible to find these items in the language files?
How can these items be translated? (I am planing to implement a button for toggling the language)Thanks!
January 8, 2017 at 10:44 am #1321173
RupokMemberHi there,
Kindly follow this thread – https://community.theme.co/forums/topic/translate-x-comments-text-on-blog-page/#post-1039472
Hope this helps.
January 9, 2017 at 2:54 pm #1322919
c1sParticipantHi, I inserted the code from this post to the functions.php in the child folder and changed the specific line to
sprintf( _n( '%s Kommentar', '%s Kommentare', $number, '__x__' ), $number );
but unfortunately, it still shows “COMMENTS” (meta below post heading)…Would it please be possible to find a solution to my questions no. 2 and 3 of my last post, too?
January 9, 2017 at 11:02 pm #1323422
ChristopherModeratorHi there,
Please update your code in functions.php file to :
// Entry Meta // ============================================================================= if ( ! function_exists( 'x_renew_entry_meta' ) ) : function x_renew_entry_meta() { // // Author. // $author = sprintf( '<span>%s</span>', get_the_author() ); // // Date. // $date = sprintf( '<span><time class="entry-date" datetime="%1$s">%2$s</time></span>', esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ) ); // // Categories. // if ( get_post_type() == 'x-portfolio' ) { if ( has_term( '', 'portfolio-category', NULL ) ) { $categories = get_the_terms( get_the_ID(), 'portfolio-category' ); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_term_link( $category->slug, 'portfolio-category' ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '"> ' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } else { $categories_list = ''; } } else { $categories = get_the_category(); $separator = ', '; $categories_output = ''; foreach ( $categories as $category ) { $categories_output .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in: “%s”", '__x__' ), $category->name ) ) . '">' . $category->name . '</a>' . $separator; } $categories_list = sprintf( '<span>%s</span>', trim( $categories_output, $separator ) ); } // // Comments link. // if ( comments_open() ) { $title = apply_filters( 'x_entry_meta_comments_title', get_the_title() ); $link = apply_filters( 'x_entry_meta_comments_link', get_comments_link() ); $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() ); $text = ( 0 === $number ) ? 'Leave a Comment' : sprintf( _n( '%s Kommentar', '%s Kommentare', $number, '__x__' ), $number ); $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments">%3$s</a></span>', esc_url( $link ), esc_attr( sprintf( __( 'Leave a comment on: “%s”', '__x__' ), $title ) ), $text ); } else { $comments = ''; } // // Output. // if ( x_does_not_need_entry_meta() ) { return; } else { printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>', $author, $date, $categories_list, $comments ); } } endif; // Individual Comment // ============================================================================= // // 1. Pingbacks and trackbacks. // 2. Normal Comments. // if ( ! function_exists( 'x_renew_comment' ) ) : function x_renew_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : // 1 case 'trackback' : // 1 ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> <p><?php _e( 'Pingback:', '__x__' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Editieren)', '__x__' ), '<span class="edit-link">', '</span>' ); ?></p> <?php break; default : // 2 GLOBAL $post; if ( X_WOOCOMMERCE_IS_ACTIVE ) : $rating = esc_attr( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ); endif; if ( x_is_product() ) { $comment_avatar = get_avatar( $comment, 240 ); } else { $comment_avatar = get_avatar( $comment, 120 ); } ?> <li id="li-comment-<?php comment_ID(); ?>" itemprop="review" itemscope itemtype="http://schema.org/Review" <?php comment_class(); ?>> <article id="comment-<?php comment_ID(); ?>" class="comment"> <?php printf( '<div class="x-comment-img">%s</div>', '<span class="avatar-wrap cf">' . $comment_avatar . '</span>' ); ?> <?php if ( ! x_is_product() ) : ?> <div class="x-reply"> <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon=""></i></span>', '__x__' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </div> <?php endif; ?> <div class="x-comment-wrap"> <header class="x-comment-header"> <?php printf( '<cite class="x-comment-author" itemprop="author">%1$s</cite>', get_comment_author_link() ); if ( x_is_product() && get_option('woocommerce_enable_review_rating') == 'yes' ) : ?> <div class="star-rating-container"> <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="star-rating" title="<?php echo sprintf( __( 'Rated %d out of 5', '__x__' ), $rating ) ?>"> <span style="width:<?php echo ( intval( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ) / 5 ) * 100; ?>%"><strong itemprop="ratingValue"><?php echo intval( get_comment_meta( $GLOBALS['comment']->comment_ID, 'rating', true ) ); ?></strong> <?php _e( 'out of 5', '__x__' ); ?></span> </div> </div> <?php endif; printf( '<div><a href="%1$s" class="x-comment-time"><time itemprop="datePublished" datetime="%2$s">%3$s</time></a></div>', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), sprintf( __( '%1$s UM %2$s', '__x__' ), get_comment_date( 'm.d.Y' ), get_comment_time() ) ); edit_comment_link( __( '<i class="x-icon-edit" data-x-icon=""></i> Editieren', '__x__' ) ); ?> </header> <?php if ( '0' == $comment->comment_approved ) : ?> <p class="x-comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', '__x__' ); ?></p> <?php endif; ?> <section class="x-comment-content" itemprop="description"> <?php comment_text(); ?> </section> </div> </article> <?php break; endswitch; } endif;Hope it helps.
January 10, 2017 at 6:31 am #1323784
c1sParticipantPerfect!! Thanks!!
January 10, 2017 at 7:26 am #1323842
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1321106 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
