Viewing 1 replies (of 1 total)
  • Image scaling for transposh – depending on Language used.

    To make an image “swap” with the language. Create the image and add “en” to the end of the name.

    EG: charityen.jpg – charityes.jpg

    Expalnation:
    the function added to the img src — [tp mylang=”y” lang=”en,es”][/tp]

    What this does is use the image with “es” if the site language spanish is on, if english then it uses the “en” picture

    Using the style=”max-width:100%;height:auto;” sets the image to 100% and will scale up or down according to the device used (mobile ready)

    Placing it in a centered div is for decoration purposes only

    <div align=”center”>
    <img src=”/htoa/wp-content/themes/happykids-child/images/charity[tp mylang=”y” lang=”en,es”][/tp].jpg” title=”Charities” style=”max-width:100%;height:auto;” />
    </div>

    This method also works with downloadables…

    EG: a pdf file (need two versions, same name, with en or es added to file name – charityes.pdf, charityen.pdf

    <FORM METHOD=”LINK” ACTION=”/htoa/wp-content/themes/happykids-child/images/charity[tp mylang=”y” lang=”en,es”][/tp].pdf” target=”_blank” />
    <INPUT TYPE=”submit” VALUE=”Clickable Button”>
    </FORM>

Viewing 1 replies (of 1 total)
  • The topic ‘Changing image according to the language’ is closed to new replies.