內容簡介
WordPress HTML 外掛允許您從頁面編輯器中添加自定義 HTML 到文章/頁面的 BODY 和 HEAD 標籤。
將 HTML 複製到 WordPress 編輯器中時,它會添加多餘的標籤,破壞各種元素並破壞 HTML。通過在自定義欄位對話框中保存 HTML,將確切的 HTML 輸出到您的文章/頁面。
此外,如果您有一個需要額外 JavaScript 库或樣式表的單獨頁面,通常必須通過您的主題 php 文件添加它。更新主題文件可能很麻煩; 我們通常必須為該單獨頁面設置一個例外,並在那裡加載它。由於在 WordPress 編輯器中編輯實際頁面時,這些信息是不可用的,因此這相當阻礙。
使用 WordPress HTML,我們可以直接將庫或樣式表添加到文章/頁面 HEAD 中,而無需更改主題文件。更重要的是,所有這些都可以從 WordPress 編輯器的該頁面中完成。
示例庫:
jQuery、ChartJS、D3js、Highcharts、Prototype
更多詳細信息:WordPress HTML
代碼:GitHub
外掛標籤
開發者團隊
原文外掛簡介
WordPress HTML allows you to add custom HTML to both the post/page BODY and the HEAD tags from the page editor.
When copying HTML into the WordPress editor it adds spurious tags which break various elements and corrupt the HTML. By saving the HTML in the custom fields dialogue the exact HTML will be output to your post/page.
Also if you have a single page which requires an extra javascript library or style sheet you normally have to add it through your themes php files. Updating the theme files can be a pain; we normally have to set up an exception for that individual page and load it there. As this information is not available when we are editing the actual pages in the WordPress editor it is quite obstructive.
With WordPress HTML, we can add the library or stylesheet directly to the post/page head without the need to change the theme files. And importantly, all from within the WordPress editor for that page.
Example libraries:
jQuery, ChartJS, D3js, Highcharts, Prototype
More details: WordPress HTML
Code: GitHub
