• Resolved juliaangel5

    (@juliaangel5)


    I want to add a footer message to all non-English versions of my pages so that the message does not appear on any English pages. The default language is English, so the footer text is in English, but I don’t want it to be displayed on any English pages. Is there a way to do this with TranslatePress?

    For example:

    [trp-exclude: “US”] Message for all non-English speakers here….[end exclude]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Cristian Antohe

    (@sareiodata)

    Hi, we don’t have an exclusion shortcode, but we do have a conditional language shortcode: https://translatepress.com/docs/translation-shortcode/

    You’ll just need to include it for each secondary language.

    Thread Starter juliaangel5

    (@juliaangel5)

    Ok. Let’s say I have 10 different languages. Can I include multiple language declarations (e.g., AR,SE,ES,HI,HE…) in a single conditional shortcode block or does it have to be a different shortcode block for each language?

    Hello @sareiodata i want to add condition in my php template how i can Do this Please help,

    Thank you in advance.

    Plugin Author Cristian Antohe

    (@sareiodata)

    You can do that in the template directly.

    
    global $TRP_LANGUAGE; 
    if ( $TRP_LANGUAGE != "en_EN" )
    {
        echo "<p data-no-translation>This appears on all other languages except english</p>";
    }
    
    Thread Starter juliaangel5

    (@juliaangel5)

    Thank you, but editing the template is harder for me in this case because the translations span multiple content types. Also, I’m not very familiar with editing templates. What about the other question I asked? Is it possible to include multiple languages in a single shortcode declaration? That would probably be easier for somebody who is not familiar with editing templates.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode for Excluding a Language?’ is closed to new replies.