- This topic has 5 replies, 2 voices, and was last updated 3 years, 5 months ago by Elvin.
-
AuthorPosts
-
October 13, 2020 at 8:28 pm #1487776Alfonso
Hi,
I am experiencing several issues while working with the Generatepress theme and the Elementor page builder. I want to change post’s comment section language from English to Spanish. Actually, I want to change “LEAVE A COMMENT” to be “¿QUE
PIENSAS? .And also cannot change the designs in the comment sections. when I’m going to edit the comment section design via Elementor, It is showing “The Theme Comments skin uses the currently active theme comments design and layout to display the comment form and comments”. From there, I haven’t any option to change comment skin. Please help me to resolve this two issues.
Thank you.
October 13, 2020 at 8:55 pm #1487802ElvinStaffCustomer SupportHi,
For translating the “Leave a comment” text, you can try this PHP snippet:
add_filter( 'gettext', function( $text ) { if ( 'Leave a comment' === $text ) { return 'Your new text'; } return $text; } );
Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/
For comment form styling, you’ll have to resort to custom CSS.
October 14, 2020 at 1:56 am #1488097AlfonsoHi,
Thank you for your support. This was not worked for me,
But below one was worked,
add_filter( ‘generate_leave_comment’,’tu_custom_leave_comment’ );
function tu_custom_leave_comment() {
return ‘¿QUE PIENSAS?’;
}October 14, 2020 at 2:24 pm #1489281ElvinStaffCustomer SupportOh yeah I forgot to mention you have to change the “Your new text” string to the text you want.
I’m glad its working for you now. 🙂
October 19, 2020 at 8:45 am #1495771AlfonsoHi,
I also need to change comment sections “thoughts on” words to Spanish. (located at the top of the comments. This shows how many comments I have)
I have used below code. But not worked for me. Could you please check and give me a solution for it.add_filter( ‘gettext’, function( $text ) {
if ( ‘thoughts on’ === $text ) {
return ‘comentarios sobre’;
}return $text;
} );Thanks
October 19, 2020 at 12:41 pm #1496109ElvinStaffCustomer SupportYou can try this out.
add_filter( 'generate_comment_form_title', function(){ return sprintf( esc_html( /* translators: 1: number of comments, 2: post title */ _nx( '%1$s comentario sobre “%2$s”', '%1$s comentarios sobre “%2$s”', $comments_number, 'comments title', 'generatepress' ) ), number_format_i18n( $comments_number ), get_the_title() ); });
-
AuthorPosts
- You must be logged in to reply to this topic.