Customize article comments

Good morning, everyone,

I would like to change the appearance of the comments under my articles (and few words that are English and not in French, the language of the website).

Do you have a few lines of code to share with me?

I remember being able to change the appearance of the blog titles thanks to CSS lines that I inserted on the website.

Thanks to all :slight_smile:

Hey Richard,

We could help you with simple styling tweaks like changing the colors and text styles. If you’re looking to change the layout though, that would require complex coding and that is beyond the scope of our support. Please tell us the exact changes you need regarding the comments area.

Regarding the English texts, you’ll need to translate them using the method described in our Translation article: https://theme.co/apex/forum/t/setup-translation/61

Thanks.

Thank you for your answer!

More specifically, I would like to change the size of this text:

Translate these sentences/words into French:

Hi Richard,

Sure, please add this CSS to Theme Options > CSS with your preferred font size.

.single-post #reply-title {
    font-size: 1em !important;
}

As for translation, I see that you’re not using multiple language so translating it this way should be okay. Please add this code to your child theme’s functions.php

add_filter( 'gettext', 'custom_string_translation', 20, 3 );

function custom_string_translation( $translated_text, $text, $domain ) {

    if ( is_singular() ) {

        switch ( trim( $translated_text ) ) {

            case 'Reply' :

                $translated_text = __( 'Répondre à Inacio', '__x__' );

                break;

            case 'Comments' :

                $translated_text = __( 'Répondre à Inacio', '__x__' );

                break;
        }

    }

    return $translated_text;
}

And please add your translation :slight_smile:

Hope this helps.

Thanks @Rad for the code, everything works except for translating “reply”:frowning:

Hi Richard,

I checked and there is a structure within that text, please change your code to this with your translation

add_filter( 'gettext', 'custom_string_translation', 20, 3 );

function custom_string_translation( $translated_text, $text, $domain ) {

    if ( is_singular() ) {

        switch ( trim( $translated_text ) ) {

            case 'Reply <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon-s="&#xf3e5;"></i></span>' :

                $translated_text = __( 'Répondre à Inacio <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon-s="&#xf3e5;"></i></span>', '__x__' );

                break;

            case 'Comments' :

                $translated_text = __( 'Répondre à Inacio', '__x__' );

                break;
        }

    }

    return $translated_text;
}

Hope this helps.

1 Like

Thanks @Rad it’s perfect ! :smiley:

Glad we were able to help :slight_smile:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.