• Resolved muckaveli

    (@muckaveli)


    Ever since whether header nor footer are showing translated contents, I am looking for workarounds.

    I’ve asked ChatGPT for advice, and it hinted to me that something like this might be possible:

    [sublanguage lang="DE"]Display this line in German[/sublanguage]

    However, this is not working, and I also couldn’t find any explanation on GitHub or in this forum.

    Is there any way to insert content like this to be displayed in one language only?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author maximeschoeni

    (@maximeschoeni)

    Hello,

    Sure, you can use something like this:

    <?php 
    global $sublanguage;
    if (isset($sublanguage) && $sublanguage->get_language()->post_name === 'de') {
      echo 'Gutentag!';
    }
    ?>

    Thread Starter muckaveli

    (@muckaveli)

    Hey Maxime,

    thank you so much for solving my problem! You have no idea what it means to me, seriously!!

    Your example works like a charm. I tried everything I saw explained on github and couldn’t get it to work (at my personal skill-level). I am beyond happy that it worked and might solve the majority of my problems.

    Thanks and please visit this support-forum again in the days to come. I really don’t mean to disturb you but I might need to ask you about other things as well.

    Plugin Author maximeschoeni

    (@maximeschoeni)

    You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there an easy way to add translated content, f.e. via shortcodes/ similar?’ is closed to new replies.