Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1142815
    Mads H
    Participant

    Hi there.

    I am losing my mind here. Been searching for a way to translate the READ MORE BUTTON in the post masonry grid.
    It should say LÆS MERE

    None of the suggestions in the forum have been able to solve the problem.

    Attached is a screendump, so you shouldn’t be in doubt.

    http://www.sundgaardadvokatfirma.dk
    Newest Wordrpress version (as of today)

    #1142818
    Mads H
    Participant
    This reply has been marked as private.
    #1143016
    Thai
    Moderator

    Hi There,

    In order to translate that string, you can simply use following code in your child theme’s functions.php file:

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {
    
    $translation = array (
    'Read More' => 'LÆS MERE'
    );
    
    if( isset( $translation[$text] ) ) {
    return $translation[$text];
    }
    
    return $translated_text;
    
    }

    Hope it helps.

    #1146442
    Mads H
    Participant

    Hi there

    I’m sorry, but it is still not working…

    Did I paste it it the wrong place?

    <?php

    // =============================================================================
    // FUNCTIONS.PHP
    // —————————————————————————–
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================

    // =============================================================================
    // TABLE OF CONTENTS
    // —————————————————————————–
    // 01. Enqueue Parent Stylesheet
    // 02. Additional Functions
    // =============================================================================

    // Enqueue Parent Stylesheet
    // =============================================================================

    add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ ); WAS ALREADY THERE…

    add_filter(‘gettext’, ‘x_translate_text’ , 20, 3);
    function x_translate_text ( $translated_text, $text, $domain ) {

    $translation = array (
    ‘Read More’ => ‘LÆS MERE’
    );

    if( isset( $translation[$text] ) ) {
    return $translation[$text];
    }

    return $translated_text;

    }

    // Additional Functions
    // =============================================================================

    ?>

    #1146623
    Christian
    Moderator

    Hey there,

    Sorry for the confusion. Since you’re using Visual Composer’s element, you will need to use a plugin such as WPML.

    Thanks.

  • <script> jQuery(function($){ $("#no-reply-1142815 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>