[WordPress] 外掛分享: Header and Footer Scripts

首頁外掛目錄 › Header and Footer Scripts
WordPress 外掛 Header and Footer Scripts 的封面圖片
200,000+
安裝啟用
★★★★
4.6/5 分(58 則評價)
47 天前
最後更新
67%
問題解決
WordPress 4.6+ PHP 5.6+ v2.4.2 上架:2014-02-19

內容簡介

如果您正在運行 WordPress 網站,早晚都需要將某種代碼插入到您的網站上。最有可能的是網頁分析代碼,例如 Google Analytics,或者是社交媒體腳本、某些 CSS 樣式表或自定義字體。這個外掛程式可以實現所有這些功能,甚至可以將這些代碼插入到自定義文章類型中。

您只需要添加適當的 HTML 代碼即可。

別忘了用適當的標籤包裹代碼。

<script type="text/javascript">
在此輸入您的 JS 代碼
</script>

或關於 CSS:

<style type="text/css">
在此輸入您的 CSS 代碼
</style>

為什麼使用這個外掛程式:

將 CSS 和 JavaScript 代碼插入到 <head> 或 </body> 前面。
將代碼插入到單個頁面或文章的 <head> 中。
將代碼插入到自定義文章類型中【新功能】。

這個外掛程式應該與 WooCommerce 兼容。

不提供的功能:

您無法插入/執行 PHP 代碼。

幾乎所有 WordPress 主題都支援此「頂部和底部腳本」插件。如果代碼未出現在您的網站上(請請求支援)或查看您的主題文件是否具有標準的 wp_head 和 wp_footer 鉤子。

重要鏈接

如需進一步信息,請關注以下鏈接:

閱讀文檔
獲取支援
GitHub 倉庫
貢獻
Digital Liberation – Blog

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.4.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Header and Footer Scripts」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

An essential WordPress plugin to easily insert scripts and styles (like Google Analytics, CSS, etc.) into your website’s header and footer.
Looking for a way to add Google Analytics, Facebook Pixel, or custom tracking code to your website’s header or footer?
Header and Footer Scripts is a simple yet powerful plugin that lets you inject code—such as Google Analytics, custom CSS, Facebook Pixel, and chat widgets—directly into your site’s header () or footer.
No bloat, no ads. This lightweight plugin simply does what it says: inserts code into your header and footer efficiently.
All you have to do is add the appropriate HTML code.
Don’t forget to wrap your code with proper tags.

Or for CSS:

Why use this plugin:

Insert scripts globally into the header and footer of your entire website.
Supports all script types including HTML, JavaScript, and CSS.
Add specific scripts to the header of individual posts or pages.
To insert code to Custom Post Type [New Feature].

The plugin should be compatible with WooCommerce.
What it does not offer

You can’t insert/execute PHP codes.

Almost all WordPress themes support this “Header and Footer Scripts” plugin. If the codes are not appearing in your site [ask for support] or look at your theme file if they have standard wp_head and wp_footer hooks.
Important Links
For further information you are welcomed to follow these links:

Read Documentation
Get Support
GitHub Repository

延伸相關外掛

文章
Filter
Apply Filters
Mastodon