這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Set HTML lang attribute per post

外掛說明

This wordpress plugin adds a meta box for specifying html lang=”” language per post.

The problem this plugin solves

WordPress allows us to specify site-wide language defaults like so:

<meta http-equiv="content-language" content="es">

The problem comes about if you have blog posts in various languages. Personally I write posts in either English or Norwegian. And since English is set as the site-wide language posts that are in Norwegian end up looking kinda weird due to weirdly placed - (hyphenations).

Solution

The solution is to add more specific html lang attributes when needed.

<article id="" class="" lang="vi">

For example this specifies that the post is in Vietnamese. This plugin enables a meta box when editing posts where you may specify the post’s language.

Contributing

This plugin was made in a jiffy. But by all means do suggest improvements. For instance the plugin obviously lacks testing code.

Licensing

Copyright 2014 Nils Norman Haukås

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

螢幕擷圖

  • screenshot-1.png

安裝方式

  1. Upload htmllang.php to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.

常見問題集

Wondering about something?

使用者評論

2017 年 6 月 9 日
Clean and simple plugin, should be no risk to use it with any theme. Looking fwd seeing if it will work for SEO purposes.
閱讀全部 3 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Set HTML lang attribute per post〉的開發相關工作。

參與者

變更記錄

0.0.1

  • Initial publish.