• Resolved utnalove

    (@utnalove)


    Hello, how can I add the gettext call to this?

    $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">Read full post</a>

    I have tried this but it doesn’t work:
    $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">__('Read full post')</a>

    How should it look like?

Viewing 11 replies - 31 through 41 (of 41 total)
  • Thread Starter utnalove

    (@utnalove)

    yes, he said to try $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">__('Read full post')</a>';
    but it doesn’t work.

    And then I was told to make it according to the documentation.

    And he added

    It looks like a wrong string and that’s why it is giving you the error, follow the instructions closely and do one line for testing exactly as the documentation and try to see if you get that error

    But it doesn’t help :/

    Thread Starter utnalove

    (@utnalove)

    I just deleted that code from the header and functions phps

    Moderator keesiemeijer

    (@keesiemeijer)

    Well the only thing I can think of is trying their forums again and pointing them to this topic. And… are you sure your theme’s textdomain is “language”. Usually theme’s will use the themename (in your case “celebritypress”) as textdomain. But then again you said:

    In the drop down menu I see there are two possibilities “default” and “language”

    . “default” are all strings without a theme textdomain and are set in the wp-config.php. Are all other textstrings with the “language” textdomain translated?

    Thread Starter utnalove

    (@utnalove)

    yes, all the rest are translated and work fine. Only the functions.php is somehow not working :/

    For example, in the same functions.php I have this:

    register_sidebar( array(
    		'name' => __( 'Left Sidebar', 'language' ),

    It was not translated.
    I found it with that plugin, I added a translation, re-created the .mo file, refreshed my wp-admin widget area, and this text appeared translated.

    So it works fine with everything else, but “read full post” :/

    Thread Starter utnalove

    (@utnalove)

    I have some updates:
    If I try with '.__('Read full post', 'language') .' no errors, but no translation.

    If I try with '.__('Read full post') .' I see the string only in the “default” not “language”. [of course after rescan].

    But also in this case, no translation at all.

    Thread Starter utnalove

    (@utnalove)

    do you have idea what may be wrong?

    Thread Starter utnalove

    (@utnalove)

    I think it is resolved.
    Thank you very much.

    Moderator keesiemeijer

    (@keesiemeijer)

    What was it that made it work?

    Thread Starter utnalove

    (@utnalove)

    There were two different “read full post” :/ don’t know why, because I can’t find where it apply …

    one is here:

    function contentnoimg($limit) {
         global $post;
          $content = explode(' ', get_the_content(), $limit);
          if (count($content)>=$limit) {
            array_pop($content);
            $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">Read full post</a>';

    and the other one is here

    function content($limit) {
         global $post;
          $content = explode(' ', get_the_content(), $limit);
          if (count($content)>=$limit) {
            array_pop($content);
            $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">'.__('Read full post') .'</a>';
    Moderator keesiemeijer

    (@keesiemeijer)

    Well I’m glad you found out what it was in the end.

    Thread Starter utnalove

    (@utnalove)

    Thank you very much for your help :)))

Viewing 11 replies - 31 through 41 (of 41 total)
  • The topic ‘Gettext calls how to – functions.php’ is closed to new replies.