douyi1341 2015-09-17 16:02
浏览 458

<?php language_attributes(); ?>在html标签上

I am trying (really hard) to understand what I do in wordpress (I am newbie coding). And I am having a problem just at the start.

ON the header.php I've seen:

enter image description here

But I don't understand why it is better to add it or what it does. I have checked it on wordpress codex and my understanding is now even worse!

Description: Displays the language attributes for the tag. The possible language attributes are dir (text direction), lang and xml:lang. The choice of lang and xml:lang depends on the $doctype argument.

So, what does it do? why is it better to use? do I have to set language_attributes function anywhere? Can someone explain it as they were explaining it to a child?

Thank you, it is really stressing me!!

  • 写回答

1条回答 默认 最新

  • dsgni26260 2015-09-17 16:07
    关注

    <?php language_attributes(); ?> adds the lang="en" attribute to your html element. This is used to indicate (e.g. for google) in which language the content of your page is.

    See What is lang attribute of the <html> tag used for?

    It also adds the dir="" attribute to your html, which idicates, if the text on your page is written from left to right (e.g. english, german, french, etc...) or from right to left (e.g. arabic, etc..)

    评论

报告相同问题?

悬赏问题

  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?