Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1466646

    I want to change the word above masonry title of password protected content. In german the word is: Geschützt

    How can i do that? I mean the word in Masonry, that give users the information that the content is password protected.

    I do not mean the text on the site, where you have to fill in the password.

    #1466655

    Screenshot

    • This reply was modified 2 months, 1 week ago by Micha66.
    • This reply was modified 2 months, 1 week ago by Micha66.
    #1466658

    Normally, the word “Protected:” (Geschützt:) is placed in front of the title of the post, and the date of creation is displayed below it.
    So have you already made any changes there?

    #1466659

    Hello Günni! I wanted you to answer. It seems to be your specialty. No, I haven’t changed anything. I want it to say “VIP membership required” instead of “Protected”.

    #1466661

    I can’t find the passage either in one of the Enfold files or in the Lang files of the translation for the various languages.
    The maximum you can always find is “password protected” – so it seems to be a WordPress setting.

    Hooray – there are WordPress filters that do that: try in your child-theme functions.php:

    function change_protected_title_prefix() {
        return 'VIP membership required: %s';
    }
    add_filter('protected_title_format', 'change_protected_title_prefix');

    if it is the german version you had to translate it by yourself
    if you do not like the double dot – get rid of it

    PS: if you like to use quotes inside that phrase you had to use entities f.e.:

    function change_protected_title_prefix() {
        return 'VIP’s only: %s';
    }
    add_filter('protected_title_format', 'change_protected_title_prefix');

    _________
    by the way: if the post is private – and you do list them

    function change_private_title_prefix() {
        return 'Admins only: %s';
    }
    add_filter('private_title_format', 'change_private_title_prefix');
    #1466667

    Wow, that’s it! Thank you so much Günni. I appreciate that.

    #1466673

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1466683

    One question at last please.
    How can i remove the very last sentence of the pw protection page where you hav to write the password?

    It is: This post is password protected. Please enter the password to access the comments.

    #1466684
    #1466685

    You can manage it by having your own translation files in your child themes folder. But it’s too much fiddling for just one phrase.

    try:

    function my_text_strings( $translated_text, $text, $domain ){
      switch ( $translated_text ){
        case 'here is the exact existing phrase'   :  $translated_text = __( 'Here is the new phrase', $domain ); break;
      }
      return $translated_text;
    }
    add_filter('gettext', 'my_text_strings', 20, 3);

    __________

    function my_text_strings( $translated_text, $text, $domain ){
      switch ( $translated_text ){
        case 'Dieser Beitrag ist passwortgeschützt. Bitte gib das Passwort ein, um Zugang zu den Kommentaren zu erhalten.'   :  $translated_text = __( 'Here is the new phrase', $domain ); break;
      }
      return $translated_text;
    }
    add_filter('gettext', 'my_text_strings', 20, 3);

    Sollte das so nicht gehen, nimm die englische Original Phrase links und rechts deine Deutsche Phrase.
    ( ‘This post is password protected. Enter the password to view any comments.’)

    #1466687

    Die Methode über eigene Sprachfiles ( de_DE_formal.po/de_DE_formal.mo und de_DE.po/de_DE.mo) ist prinzipiell sauberer.
    Dazu müsstest du die po files bearbeiten und eine Kopie (vorzugsweise in den Ordner “lang”) im child-theme folder platzieren.
    Dem Thema muss man dann noch sagen wo die Files liegen:

    function overwrite_language_file_child_theme() {
        $lang = get_stylesheet_directory().'/lang';
        return $lang;
    }
    add_filter('ava_theme_textdomain_path', 'overwrite_language_file_child_theme');

    Bearbeiten kannst du die Files mittels poedit – Du musst dort die englische Phrase finden, und die neue deutsche Übersetzung dann einfügen. ( es kann mehrere Stellen geben wo das auftritt.) Poedit speichert dann beide Versionen (po/mo) ab. Diese in den Lang Ordner hochladen.

    Deutsch ist nochmal ein Sonderfall, weil es meherer Sprachfiles auch schon wegen Du/Sie gibt.

    ___________________

    The method using your own language files ( de_DE_formal.po/de_DE_formal.mo and de_DE.po/de_DE.mo) is generally cleaner.
    To do this, you would have to edit the po files and place a copy (preferably in the ‘lang’ folder) in the child-theme folder.
    You then have to tell the theme where the files are located:

    see codesnippet above

    You can edit the files using poedit – you must find the English phrase there and then insert the new German translation. (There may be several places where this occurs.) Poedit then saves both versions (po/mo). Upload them to the Lang folder.

    German is another special case, because there are already several language files because of different salutations: Du / Sie.

    #1466690

    Ich wollte diesen letzten Satz komplett entfernen.

    #1466692

    Das denke ich kannst du mit css und dem geeigneten Selektor am besten.
    Habe leider keine Beispielseite, wo ich den selektor dir nennen könnte. Hast du auf der Jordan Seite ein Beispiel?

    #top.single .post-entry.post-password-required ~ p {
      display: none;
    }

    if it is always the last paragraph this might help!

    #1466732

    I am so thankfull again, Günni. Dankeschön!

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Change the word above masonry title of password protected content’ is closed to new replies.